フィルターのクリア

I'm trying to generate a code that calculates the fourier series coefficients of a period.

1 回表示 (過去 30 日間)
Joshua Brantley
Joshua Brantley 2014 年 3 月 2 日
コメント済み: Rick Rosson 2014 年 3 月 2 日
such as: x(tc) = {1 if 0<=tc<5 and -0.5 if 5 <=tc<10}
I am given the fundamental period as 10 seconds.
The continuous time tc can be approximated as the discrete time, td, whose sampling frequency is 1kHz.

回答 (1 件)

Rick Rosson
Rick Rosson 2014 年 3 月 2 日
編集済み: Rick Rosson 2014 年 3 月 2 日
Fs = 1000;
dt = 1/Fs;
t = (0:dt:10-dt)';
N = size(t,1);
x = ones(N,1);
x(t>=5) = -0.5;
X = fftshift(fft(x))/N;
dF = Fs/N;
f = (-Fs/2:dF:Fs/2-dF)';
figure;
stem(f,abs(X));
  2 件のコメント
Joshua Brantley
Joshua Brantley 2014 年 3 月 2 日
So what exactly is the plot telling me? I just learning about Fourier series the other day in class and I'm little confused.

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

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by