FFT of Signal doesn´t work well

3 ビュー (過去 30 日間)
Cedric Burkhart
Cedric Burkhart 2021 年 8 月 30 日
編集済み: Cedric Burkhart 2021 年 8 月 30 日
Hi,
I would like to have a FFT of a constant signal with two Dirac jumps.
My signal is correct, but my FFT shows nothing. May somebody could help me?
It´s the following code:
t = [1:361] ; % in Grad, Gesamtumdrehung sind 360°
f(t(1):t(end)) = 0; % f = Signal
% Magnets
N = 23; % Amount of magnets
n = 2; % selected magnets
a = 360/n ; % distance between magnets
% Signal 1 = Dirac
tsprung = 20;
tsprung2 = tsprung + a;
f(tsprung)= 1;
f(tsprung2)= f(tsprung);
subplot(211);
plot (t,f);
xft = fft(f);
xabs = abs(xft);
subplot(212);
plot (xabs);
set(gca, 'XTick',[0:20:360])
set(gca, 'YTick',[0:0.1:1])
xlabel ('Position der Magneten in Grad');
ylabel ('Stoß');
legend ('Signal');
THANKS A LOT !

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 8 月 30 日
xabs(2nd Plot) is the absolute of fft ??
  1 件のコメント
Cedric Burkhart
Cedric Burkhart 2021 年 8 月 30 日
編集済み: Cedric Burkhart 2021 年 8 月 30 日
Yes it should show the absolut numbers of the fft, but if it works without the abs then it will be good as well.
I just wanna see how the frequency-spectrum is before and after the dirac jump.

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

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by