フィルターのクリア

How do I take the fft of a signal after I using the blackman window?

17 ビュー (過去 30 日間)
SCuri
SCuri 2019 年 3 月 6 日
回答済み: Enthusiastic Student 2019 年 3 月 8 日
I have written the following code for putting the blackman window on the data :
window = blackman(length(strain_seg)); %the length of the strain_seg is 256^2
windowed_strain = strain_seg*window;
How do I perform an fft of the windowed strain? Do I need to use the rfft function?
  1 件のコメント
SCuri
SCuri 2019 年 3 月 7 日
Updated code:
M = length(strain_seg);%this length is 65536 x1
w = blackman(M);% length 64 x 1
C = [strain_seg,zeroes(65536,63)]; % added zeroes to the strain data to match the dimension of the window to I could multiply
xw = C.*w;
X = fft(xw)
How do I plot this signal as Strain vs Frequency ?

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

採用された回答

Enthusiastic Student
Enthusiastic Student 2019 年 3 月 8 日
I think you might have issue with dimensions early on.
Have you tried to see what
size(strain_seg)
length(strain_seg)
actually output? I'm guessing the strain_seg has a size of [65536 1] and the blackman has a size of [1 64], which is why you have to add zeroes. I would suggest transposing one of them using the ' operator:
M = length(strain_seg);
w = blackman(M);
xw = C.*w';
X = fft(xw)
With regards to plotting the fft of the windowed strain segment you would need to know the time the segment spans. Lets say the segment you are examining was taken over 10 ms:
Ts = 10e-3; %samples taken in a 10 ms long period of time /[s]
dt = 1/Ts; %/[Hz]
freq = dt:dt:(dt*length(xw)+dt); %Frequencies
figure
loglog(freq,abs(X));
xlabel('Frequency /[Hz]')
ylabel('Magnitude of FFT')

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by