How to remove sinc wiggles or truncation artifact?

7 views (last 30 days)
While applying FFT to the data (fig 1 ), it is supposed to give a sinc function (like fig 4) without any wiggles/artifacts (as in fig 3) and sometimes It may give 3 peaks in the output, that is ok. I have used gaussian window to bring the data points to zero line and then added zero to make 128 points (fig 2). Is there any other methods to process the data (like gaussian window) so that when FFT is taken it will give the expected result. Please see that data and figure attached.
data=[ d1 d2 .... d44]; % 44 data points
n=[63:-1:0 1:64];
gau_ar=gaussmf(m,[8 0.5]); # gaussian window
g_data=data.*gau_ar; # * raw data with gaussian window
% add zeros equally left and right so as to make it 128 points. g_data now has 128 points.
op_data=fftshift(fft(g_data)); % take fft
  1 Comment
Adam
Adam on 26 Sep 2016
The sinc function is the result of running a Fourier Transform on a rectangular function isn't it? So why do you expect that you should get a sync function from the fft or your function here?

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 26 Sep 2016
You are not padding your original signal correctly. Padding it at both ends introduces phase distortions that are then impossible to correct. This will affect the plot of the Fourier transformed signal. I would let the fft function do the zero-padding (it does this correctly, so there is no phase distortion).
Also, your frequency vector is incorrect. Zero-padding increases the frequency resolution, so you have to adjust your frequency vectors accordingly.
This works:
d = load('dsp data.mat');
figgg = d.figgg; % Assign Loaded Data
L = length(figgg); % Length Of Data
t = 1:L; % Time Vector
Ts = 1; % Sampling Time
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FT = fft(figgg)/L; % Fourier Transform Of Original Skiglan
Fvs = (-L/2:L/2-1)*Fn; % Centre-Shifted Frequency Vector
FTs = fftshift(FT); % Shift FFT
figure(1)
subplot(2,1,1)
plot(Fvs, abs(FTs)) % Plot FFT Of Original Signal
grid
xlabel('Frequency')
ylabel('Amplitude')
title('Fourier Transform of Original Signal')
Lp = log(128)/log(2); % Pad To Length = 128
FTp = fft(figgg, 2^Lp)/L; % Fourier Transform Of Zero-Padded Signal
Tsp = (2^Lp)/L; % Sampling Interval Of Zero-Padded Signal
Fsp = 1/Tsp; % Sampling Frequency Of Zero-Padded Signal
Fnp = Fsp/2; % Nyquist Frequency Of Zero-Padded Signal
Fvsp = (-(2^Lp)/2:(2^Lp)/2-1)*Fnp; % Centre-Shifted Frequency Vector Of Zero-Padded Signal
FTps = fftshift(FTp); % Shift FFT
subplot(2,1,2)
plot(Fvsp, abs(FTps))
grid
xlabel('Frequency')
ylabel('Amplitude')
title('Fourier Transform of Zero-Padded Signal')

Products

Community Treasure Hunt

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

Start Hunting!