Phase of Fourier Transformed Signal for increasing Zero-Padding values
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I've been playing around with Matlab and I just noticed something that I can not fully understand. The problem is quite simple: I simply want to plot Amplitude and Phase responses of a Fast Fourier Transformed chirp signal. When using the FFT command, it is also possible to add zeros in order to increase the resolution of the Fourier Transformed signal. I wrote down a very simple code that performs the aforementioned task within a loop. For each different cycle of the loop, a different Zero-Padding value is used. Here you can find the code:
clear all;
close all;
clc;
%
%%PARAMETERS SETTING - SIGNAL.
Tp = 42E-6; %Pulse duration, [s].
B = 17.2E6; %Bandwidth, [Hz].
K = B/Tp; %Chirp rate, [Hz/s].
%
%%PARAMETERS SETTING - SAMPLING.
OS = 1.5; %Oversampling factor.
Fs = OS*B; %Sampling Rate, [Hz].
Ts = 1/Fs; %Sampling Time, [s].
%
%%AXIS GENERATION - RANGE TIME.
t = 0:Ts:(Tp - Ts); %Range Time, [s].
t = t - median(t); %Range Time centered wrt '0', [s].
NoS = length(t); %Number of Fast Time Samples.
%
NoFFT = 2048;
f = 0:(1/NoFFT):(1 - 1/NoFFT); %Normalized Range Frequency.
f = f - 0.5;
f = f*Fs; %Range Frequency, [Hz].
%
%%SIGNAL GENERATION - SIGNAL.
win = abs(t) <= Tp/2;
Phi = 2*pi*(B/(2*Tp))*t.^2;
s = exp(+1i*Phi).*win;
%
figure;
for k = length(s):NoFFT
H2 = fft(s, k);
%
%%PLOTTING - MATCHED FILTER.
subplot(2, 1, 1);
plot(1:k, abs(H2));
grid on;
xlabel('Frequency Bin');
ylabel('Amplitude');
xlim([1 k]);
title('Magnitude of spectrum');
subplot(2, 1, 2);
plot(1:k, unwrap(angle(H2)));
grid on;
xlabel('Frequency Bin');
ylabel('Phase [rad]');
xlim([1 k]);
title('Phase of spectrum');
drawnow;
end
It looks like the amplitude response does not change when using different Zero-Padding values. Yes, the number of frequency bins change, so it is not possible to compare two signals of different length. However, the envelops do not change. Vice versa, it looks like Zero-Padding has got a huge impact on the Phase response. At the very beginning, when the Zero-Padding is not performed, the Phase response is a quadratic function of the frequency (as I would expect from a chirp signal). However, increasing the Zero-Padding value impacts on the Phase response: in fact, I can not explain the result which is produced at the very end of the loop.
Is anyone able to help me understand these results?
Thanks,
Emiliano
0 commentaires
Réponses (1)
David Goodmanson
le 19 Sep 2016
Modifié(e) : David Goodmanson
le 19 Sep 2016
I believe this is related to the fact that when you pad the signal, you are effectively translating it to the left in the time array, and a translated waveform in the time domain introduces a phase factor in the frequency domain.
If you don't let fft do the zero padding but rather modify s appropriately and then use fft:
Padding s with zeros on the left you get the same effect on the phase as before, only reversed left to right. Padding with zeros equally on both sides of s, the effect goes away.
Interesting movie.
0 commentaires
Voir également
Catégories
En savoir plus sur Digital Filtering dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!