フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Help with FFT Analysis

2 ビュー (過去 30 日間)
Vince Roman
Vince Roman 2015 年 2 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
How could I use the fft analysis on this signal:
I am trying to find which filter would be the most ideal to get as close to the original signal as I can.
% Signal Generation
xLim = 1000; % Generate numbers from 0 to 1000.
dx = 0.01; % Increment of 0.01.
x = 0:dx:xLim-1; % Generate a series of numbers from 0 to 999 (xLim-1) with increment of 0.01.
y0 = 6*sin(0.4*pi*x); % Create sine signal.
y = awgn(y0,0.01,'measured'); % Addition of noise
% Filtering of Noise using Savitzky-Golay
N = 2;
% Filter 1 F = 11; % Window length 11,23,35,47,59
[b,g] = sgolay(N,F); % Calculate S-G coefficients
HalfWin = ((F+1)/2) -1;
for n = (F+1)/2:(length(x)-5)-(F+1)/2,
% Zeroth derivative (smoothing only)
SG1(n) = dot(g(:,1),y(n - HalfWin:n + HalfWin));
end
% Filter 2 F = 23; % Window length 11,23,35,47,59
[b,g] = sgolay(N,F); % Calculate S-G coefficients
HalfWin = ((F+1)/2) -1;
for n = (F+1)/2:(length(x)-5)-(F+1)/2,
% Zeroth derivative (smoothing only)
SG2(n) = dot(g(:,1),y(n - HalfWin:n + HalfWin));
end
At the moment I tried to use: A1=fft(SG1); A2=fft(SG2);
Not really sure how to apply the fft coding and if I am doing it correctly, I was told I can also use snr after between the filtered data and the fft data after carrying out the FFT analysis of the noisy signal
Thanks

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by