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