Тёмный

How DFT zero padding works 

David Dorran
Подписаться 19 тыс.
Просмотров 29 тыс.
50% 1

An explanation of how zero padding works.
Documentation on the DFT is available at dx.doi.org/10.13140/RG.2.2.330...
Other notes available at at pzdsp.com/docs.
See dadorran.wordpress.com/2013/12... for matlab code used in the video.

Опубликовано:

 

19 дек 2013

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@peerpraia672
@peerpraia672 8 лет назад
I don't know how to thank you enough for this video. Please keep on doing this kind of tutorials, they are the best that exist on the web.
@serkanimerkopi384
@serkanimerkopi384 9 лет назад
Thank you! I was looking for an explanation to why zero padding works and you explained it in a great way!
@bleardloshaj3692
@bleardloshaj3692 5 лет назад
Such a hero!
@maitripatel137
@maitripatel137 8 лет назад
Hello Sir , I just wanted to say that all of these videos are v. useful ..I am enjoying this Digital signal processing now..Thank you so much ..:)
@ImaginaryHuman072889
@ImaginaryHuman072889 10 лет назад
excellent video, thanks!
@shashu1999
@shashu1999 4 года назад
excellent video!
@jairovideo
@jairovideo 4 года назад
Great video!
@fahimjafari1764
@fahimjafari1764 4 года назад
Thank you! it was excellent
@nazmussalehin7512
@nazmussalehin7512 7 лет назад
Is it possible to make a music recommender system using these basis functions ? Just comparing with the signal being analyzed ?
@jamiestacey3384
@jamiestacey3384 7 лет назад
Hi Mr Dorran, I have been watching your videos and using your code outline for part of my dissertation project and find your work very helpful, so thanks for that. I am currently struggling to effectively zero pad an audio recording and cant understand why. My code reads: clc clear all close all [x, fs]=audioread('Front_Right2.m4a'); % x is the signal, fs is the sample rate Ts=1/fs; % sample interval N=length(x); % number of samples in the signal k=0:N-1; t=k*Ts; %time axis Seg1=x(1:1323000); x_zpad = [Seg1 zeros(1, 100000)]; %zero pad X_ZPAD_mags= abs(fft(x_zpad)); %plot signal figure(1) subplot(211) plot(k,Seg1) xlabel('Samples from 0-30 seconds') ylabel('amplitude, volts') title('Segment One From 0-30 Seconds') This is producing an error: Error using horzcat Dimensions of matrices being concatenated are not consistent. Error in Front_Right_windowing (line 15) x_zpad = [Seg1 zeros(1, 100000)]; %zero pad Could you provide help on why this is not possible? Thanks Scott
@sheikabdulrahman
@sheikabdulrahman 6 лет назад
Hello David, I am trying to understand the FFT, zero padding and windowing functionalities. Unfortunately, I don't have access to Matlab. I found an application note which does the FFT on 8051 uC. www.silabs.com/documents/public/application-notes/an142.pdf I got samples for sinewave 10Hz signal. When I run FFT for 128 samples the magnitude at 10Hz is 108(for e.g.) and when I zero padded it by another 128 samples the magnitude at 10Hz become 49 but the magnitude around 9Hz and 11Hz got increased to 29 and 31. In your video, you mentioned the magnitude of the signal doesn't change with zero padding but I am seeing a bit variation from that. Any possible explanation for that? Please reply. Regards Sheik
@eyaleyal9495
@eyaleyal9495 7 лет назад
Hi David, Your videos are very helpful to me to get intuition. Thank you! One thing I don't understand is why only non-integer frequency of a sine wave causes the spectrum to spread over few bins. Can't it happen with integer multiples, if the resolution is not high enough ?
@ddorran
@ddorran 7 лет назад
Have you taken a look at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-V_dxWuWw8yM.html. It might help.
@eyaleyal9495
@eyaleyal9495 7 лет назад
It did help, thanks. I understand now what you meant by integer and non integer. There are though couple of questions I would like to ask: 1. Is the problem really about cutting a signal at a point where its slope is steep ? can we say that windows like Hunning are meant to make the slope at the cutting point close to 0, so the signals energy won't be spread too much (what I remember from a course I have taken is that a infinite signal in time has a finite spread in spectrum, while a finite signal (same as cutting the signal in a steep point) has infinite spread in spectrum) ? 2. Do I understand correctly - zero padding at the end of a signal just makes more bins / better frequency resolution ?
@ddorran
@ddorran 7 лет назад
1. Yes a sharp "cut" in the time domain does correspond to a broad spread in the frequency domain. An impulse and step signals being an extreme examples of this. The window 'softens' this effect. 2. Yes (sort of) it does improve DFT frequency bin resolution but not your ability to discriminate between frequency components in the signal. See ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eg8eebQPfAo.html
@andreregis13
@andreregis13 10 лет назад
Congratulations for your explanation. I've been watching your DFT videos. I would like to ask you, professor. How can I define the length of zero padding? You put the code: x = [x zeros(1,1000)], may I use x = fft(x,L) instead? ( where L =1000) I am new in MATLAB, sorry. Thanks!
@ddorran
@ddorran 10 лет назад
with x = [x zeros(1,1000)] you are zero padding by 1000 samples so x is 1000 samples longer that it originally was. With x=fft(x,L) if L =1000 the signal will be forced to being 1000 samples before the fft is applied. e.g. if x was 200 samples it would be zero padded by 800 samples before applying the fft. However if x was 1500 samples the last 500 samples of x would be discarded before the fft was applied
@andreregis13
@andreregis13 10 лет назад
David Dorran Thanks for your reply, professor, but: 1- how can I define the length of zero padding? 2- About your explanation, I understood that is better choose x = [x zeros(1,L)] than x = fft(x,L). Am I right? Thanks.
@ddorran
@ddorran 10 лет назад
André Luiz Regis Monteiro X = fft(x, length(x) + L); should zero pad by L samples
@andreregis13
@andreregis13 10 лет назад
David Dorran Thank you very much, professor.
@andreregis13
@andreregis13 9 лет назад
Hello professor. It's me again. I would like to ask you about bring back the real magnitude of original signal after applying zero-padding. I am thinking multiply the result as bellow: fft(signal_after_zeropadding)*(1/B), where B= length(signal_after_zeropadding)/length(original_signal); Is it correct? Thanks a lot!!
@ddorran
@ddorran 9 лет назад
I'm not sure if I understand the question correctly but I think it should be fft(signal_after_zeropadding)/(N/2) where N is the length of the original signal. Try creating a sinusoidal signal and testing it out on that.
@andreregis13
@andreregis13 9 лет назад
David Dorran Thank you professor! I will test this and after I will reply you back. Regards.
@andreregis13
@andreregis13 9 лет назад
David Dorran Sorry for a long time. It works. Thanks.
@pedromuseros4518
@pedromuseros4518 2 года назад
Great video and interesting discussion on the true amplitude, thanks! Regarding the DC component, would one obtain its true amplitude by dividing over N, or over N/2?
@rajaduraikanniappan5327
@rajaduraikanniappan5327 10 лет назад
Hi David.. your videos are life saving . One small doubt, Zero padding by large amount means, how much ? Thanks in advance.
@ddorran
@ddorran 10 лет назад
For me its zero padding to such an extent that my computer grinds to a halt! In my case this means zero padding so that the length of the signal becomes about 100 million samples.
@rajaduraikanniappan5327
@rajaduraikanniappan5327 10 лет назад
thanks..
@fiberkinetics
@fiberkinetics 10 лет назад
also, great accent. more people should talk with irish accents.