# Fourier series and transform of Sinc Function

47 ビュー (過去 30 日間)
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 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 件のコメント表示 2 件の古いコメント非表示 2 件の古いコメント
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 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 件のコメント表示 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.

サインインしてコメントする。

### カテゴリ

Find more on Spectral Measurements in Help Center and File Exchange

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by