Presentation is loading. Please wait.

Presentation is loading. Please wait.

Zero-Padding vs Increasing the Observation Size

Similar presentations


Presentation on theme: "Zero-Padding vs Increasing the Observation Size"— Presentation transcript:

1 Zero-Padding vs Increasing the Observation Size
By: Prof. Dr. Erhan A. İnce Electrical and Electronic Engineering Dept. FALL

2 A: Zero padding the input sequence and how it affects DFT
B: Effect of Increasing window length for input x[n] on frequency resolution

3 Frequency Interval/Resolution Comparison
DFT’s frequency resolution ∆ Fres ∼ 1/NT [Hz] and covered frequency interval ∆F = N∆Fres = 1/T = Fs [Hz]. Frequency resolution is determined only by the length of the observation interval, whereas the frequency interval is determined by the length of sampling interval.

4

5 Example (DFT Resolution): Two complex exponentials with two close frequencies F1 = 10 Hz and F2 = 12 Hz sampled with the sampling interval T = 0.02 seconds. Consider various data lengths N = 10, 15, 30, 100 with zero padding to 512 points. DFT with N = 10 and zero padding to 512 points. Not resolved: F2 − F1 = 2 Hz < 1/(NT) = 5 Hz.

6 DFT with N = 15 and zero padding to 512 points
DFT with N = 15 and zero padding to 512 points. Not resolved: F2 − F1 = 2 Hz < 1/(NT) ≈ 3.3 Hz.

7 DFT with N = 30 and zero padding to 512 points
DFT with N = 30 and zero padding to 512 points. Resolved: F2 − F1 = 2 Hz > 1/(NT) ≈ 1.7 Hz.

8 DFT with N = 100 and zero padding to 512 points
DFT with N = 100 and zero padding to 512 points. Resolved: F2 − F1 = 2 Hz > 1/(NT) = 0.5 Hz.

9 If zero-adding does not make the DFT a better approximation of the DFTF why do we use it?
There are two reasons We want more densely spaced samples of the DFT (usefull when showing it graphically) We want out input sequence length to be a power of two (for using FFT)

10 If zero padding does not help more accurately recover the two impulses for the input signal
x[n] how can we get a better representation of the two impulses? Ans: We must widen our window of x[n]

11 fs = 100; T = 1/fs; N = 300; n = 0:N-1; t = n*T; x = cos (2*pi*3*t); X_mags = abs(fft(x)); subplot(2,1,1) plot(x) xlabel('Samples'); ylabel('Amplitude'); title('Time domain signal') num_disp_bins = 25; subplot(2,1,2) plot([0:num_disp_bins-1],X_mags(1:num_disp_bins),'k.'); hold on plot([0:num_disp_bins-1],X_mags(1:num_disp_bins)) hold off xlabel('Frequency Bins'); ylabel('Magnitude'); title('Frequency Magnitude')

12

13 x1= [zeros(1,362) x zeros(1,362)];
N = length(x1); n= 0:N-1; X_mags1 = abs(fft(x1)); figure subplot(2,1,1) plot(n,x1) subplot(2,1,2) plot(X_mags1 )

14

15 x22= [zeros(1,724) x zeros(1,724)];
N = length(x22); n= 0:N-1; X_mags1 = abs(fft(x22)); figure subplot(2,1,1) plot(n,x22) subplot(2,1,2) plot(X_mags1 )

16

17 fs = 100; T = 1/fs; N = 800; n = 0:N-1; t = n*T; xnew = cos (2*pi*3*t); xnew= [zeros(1,112) xnew zeros(1,112)]; N = length(xnew); n= 0:N-1; X_mags = abs(fft(xnew)); figure subplot(2,1,1) plot(n,xnew) subplot(2,1,2) plot(X_mags )

18 Window size 800 Padded to 1024

19 fs = 100; T = 1/fs; N = 1500; n = 0:N-1; t = n*T; xnew = cos (2*pi*3*t); xnew= [zeros(1,274) xnew zeros(1,274)]; N = length(xnew); n= 0:N-1; X_mags = abs(fft(xnew)); figure subplot(2,1,1) plot(n,xnew) subplot(2,1,2) plot(X_mags )

20 Window size 1500 Zero padded to 2048

21 Conclusion Zero padding does not help increase the resolution. Widening the window size (wider observation interval) helps obtain better frequency resolution.


Download ppt "Zero-Padding vs Increasing the Observation Size"

Similar presentations


Ads by Google