フィルターのクリア

FFT of signal from text file

19 ビュー (過去 30 日間)
John Smith
John Smith 2015 年 11 月 19 日
コメント済み: krn99 2017 年 6 月 5 日
Hi, I am trying to plot an FFT for an EMG signal which is saved in a text file. I did manage to plot the actual signal, but when I plotted the FFT, the window remained blank. Can someone please highlight what I am doing wrong. Also, How to determine the sampling frequency value (Fs)?
Attached please find the text file containing the EMG signal data. Thanks in advance.
Ts = mean(diff(t)); % Sampling Time
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FEMG = fft(EMG)*2/L; % Fourier Transform (Normalised)
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
figure(1)
plot(Fv, abs(FEMG(Iv)))
grid

採用された回答

Star Strider
Star Strider 2015 年 11 月 20 日
I don’t see the error in your code, but the code here I wrote (plotting half of the fft) works:
fidi = fopen('John Smith emg.txt', 'rt');
T_EMG = textscan(fidi, '%f%f', 'Delimiter',' ');
t = T_EMG{1};
EMG = T_EMG{2};
L = length(t);
Ts = mean(diff(t)); % Sampling Time
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FEMG = fft(EMG)*2/L; % Fourier Transform (Normalised)
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
figure(1)
plot(Fv, abs(FEMG(Iv)))
grid
  7 件のコメント
Star Strider
Star Strider 2017 年 5 月 28 日
My pleasure.
krn99
krn99 2017 年 6 月 5 日
sir i have used 10hz cutt of freq(fc) high pass and 1000hz fc for low pass FIR filter(4th order). i have used filtfilt function to avoid zero lag. But my doubt is do i want to do divide my cut off frequency with 0.802 for fourth order which is mentioned in Winters and Robertson book. i dont understand their concept. if you know please tell me. Thanks in advance

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

その他の回答 (0 件)

カテゴリ

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