Fourier series and transform of Sinc Function

조회 수: 17 (최근 30일)
cikalekli
cikalekli 2021년 12월 24일
댓글: Paul 2022년 1월 2일
Does the line spectrum acquired in 2nd have a sinc envelope like the one obtained in 3rd?
Here is my code below:
x = [-5:0.001:5];
y = sinc(x);
plot(x,y);
% 2nd sinc graph:
duty = 0.2;
n = [0:1:15];
cn = 5 * duty * abs(sinc(n*duty));
bar(n*duty,cn);
hold on
% 3rd sinc graph:
n = [0:0.001:3];
plot(x,abs(sinc(x)));

채택된 답변

Paul
Paul 2022년 1월 1일
편집: Paul 2022년 1월 1일
Hello @cikalekli,
The second and third graph are both plots of the magnitude of the sinc() function, so it would appear that the third must evelop the first.
Perhaps I've misunderstood the question ....
  댓글 수: 3
cikalekli
cikalekli 2022년 1월 2일
Dear David,
Thank you for understanding me. It means a lot to me. Literally I asked that approx. 1 week ago and I could not understand why someone did not help even I was clear with my question and my codes.
I literally even showed my progress with my code outputs as well.
Finally you did understood my question and elaborate it smoothly.
Thanks a lot and happy new year...
Paul
Paul 2022년 1월 2일
Perhaps a stem plot would be more appropriate for this type of plot
x = [-5:0.001:5];
duty = 0.2;
n = [0:1:15];
cn = 5 * duty * abs(sinc(n*duty));
stem(n*duty,cn); % changed bar to stem
hold on
% 3rd sinc graph:
% n = [0:0.001:3];
plot(x,abs(sinc(x)));

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Kshitij Chhabra
Kshitij Chhabra 2021년 12월 31일
Hi,
You can try leveraging the Curve Fitting Toolbox offering from MATLAB to get insights on how to plot a curve over the bar chart.
You can check the various examples to get a clearer insight. Once the curve is optained, you can compare the values between the two plots.
Hope it helps!
  댓글 수: 2
Rik
Rik 2022년 1월 1일
@cikalekli, Why don't you post a comment explaining what would be wrong with this answer? If you just reject the answer flagging it as misinformation, that will not encourage anyone to help you.
You have a question. Apparently Kshitij didn't provide an answer that you were happy with. Remember that this process has many steps: first you have a problem, then you tried to explain it, then Kshitij read it, tried to understand it, found two links for you, and wrote up an answer. Then you read it and tried to understand it.
ALL those steps must go well for you to be happy with the result. This is the internet, so you can't assume to have the same linguistic and cultural background as anyone responding. Kshitij took the time to attempt to help you. Now you can repay that kindness by explaining why this isn't what you meant. Flagging accurate (though apparently not helpful) information as 'misinformation' isn't going to help you.
cikalekli
cikalekli 2022년 1월 1일
편집: cikalekli 2022년 1월 1일
I apologize for my inappropriate behavior. But I asked everything clearly in my question. I never expected an answer from anyone. I just wanted to ask about the correctness and relevance of my code. That's why I reacted to such a response that came days later. Where did I go wrong? I wonder if I should have asked differently when asking a question? What is the error in my question while posting here please? Again pardon me and I am not going to do the same mistake ever again. Thank you for your understanding as well.
Edit: Typo correction.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by