DSPRelated.com
Forums

Zero padding fftw

Started by simwes December 8, 2010
On Dec 8, 10:59�pm, eric.jacob...@ieee.org (Eric Jacobsen) wrote:
> On Wed, 8 Dec 2010 19:39:21 -0800 (PST), Greg Heath > > <he...@alumni.brown.edu> wrote: > >On Dec 8, 1:23=A0pm, "simwes" <olivetti81@n_o_s_p_a_m.libero.it> wrote: > >> =A0Hello everybody > > >> I am writing a code to transform an array from the frequency domain to ti= > >me > >> domain using the fftw. In order to increase the resolution of the signal = > >in > >> the time domain I am adding zero in the frequency before sending it to th= > >e > >> fftw. > > >This is fourier interpolation. This does not increase > >resolution. The only way to increase resolution is to > >increase the originak time sampling rate. > > Not really. &#4294967295; Resolution is increased by increasing the observation > time. &#4294967295; This means either increasing the number of samples in the FFT > window, or sampling more slowly.
You are thinking of freqency resolution; fres = 1/(max(t)+dt)= 1/(N*dt) For time resolution tres = 1/(max(f)+df) = 1/ (N*df) = 1/Fs Hope this helps. Greg
On Dec 8, 11:43&#4294967295;pm, Greg Heath <he...@alumni.brown.edu> wrote:
> On Dec 8, 10:39&#4294967295;pm, Greg Heath <he...@alumni.brown.edu> wrote:> On Dec 8, 1:23&#4294967295;pm, "simwes" <olivetti81@n_o_s_p_a_m.libero.it> wrote: > > > > &#4294967295;Hello everybody > > > > I am writing a code to transform an array from the frequency domain to time > > > domain using the fftw. In order to increase the resolution of the signal in > > > the time domain I am adding zero in the frequency before sending it to the > > > fftw. > > > This is fourier interpolation. This does not increase > > resolution. The only way to increase resolution is to > > increase the originak time sampling rate. > > > > The problem is that the signal in the time domain > > shifts as I add zero in > > > > the array in the frequency domain! I don't understand > why! > > > Please can someone help me? > > > The zeros have to be symmetric about the Nyquist > > frequency. > > Clarification: > > The zeros have to maintain the symmetry. > > > The exact formula depends on whether N > > is even or odd. > > If N is odd > > [ X(1:(N+1)/2)) zeros(1,M) X((N+3)/2:N) ] > > If N is even > > [ X(1:N/2) 0.5*X(N/2+1) zeros(1,M) ... > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;0.5*X(N/2+1) X(N/2+2:N) ]
Of course I used the despised MATLAB index convention with Xdc = X(1). Hope this helps. Greg
On Wed, 8 Dec 2010 20:52:03 -0800 (PST), Greg Heath
<heath@alumni.brown.edu> wrote:

>On Dec 8, 10:59=A0pm, eric.jacob...@ieee.org (Eric Jacobsen) wrote: >> On Wed, 8 Dec 2010 19:39:21 -0800 (PST), Greg Heath >> >> <he...@alumni.brown.edu> wrote: >> >On Dec 8, 1:23=3DA0pm, "simwes" <olivetti81@n_o_s_p_a_m.libero.it> wrote= >: >> >> =3DA0Hello everybody >> >> >> I am writing a code to transform an array from the frequency domain to= > ti=3D >> >me >> >> domain using the fftw. In order to increase the resolution of the sign= >al =3D >> >in >> >> the time domain I am adding zero in the frequency before sending it to= > th=3D >> >e >> >> fftw. >> >> >This is fourier interpolation. This does not increase >> >resolution. The only way to increase resolution is to >> >increase the originak time sampling rate. >> >> Not really. =A0 Resolution is increased by increasing the observation >> time. =A0 This means either increasing the number of samples in the FFT >> window, or sampling more slowly. > >You are thinking of freqency resolution; >fres =3D 1/(max(t)+dt)=3D 1/(N*dt) > >For time resolution >tres =3D 1/(max(f)+df) =3D 1/ (N*df) =3D 1/Fs > >Hope this helps. >
Yuppers...reading failure on my part.
>Greg
Eric Jacobsen Minister of Algorithms Abineau Communications http://www.abineau.com
On Dec 8, 12:23&#4294967295;pm, "simwes" <olivetti81@n_o_s_p_a_m.libero.it> wrote:
> &#4294967295;Hello everybody > > I am writing a code to transform an array from the frequency domain to time > domain using the fftw. In order to increase the resolution of the signal in > the time domain I am adding zero in the frequency before sending it to the > fftw. > The problem is that the signal in the time domain shifts as I add zero in > the array in the frequency domain! I don't understand why! > Please can someone help me? > > Thank you very much!
Zero-padding buys you absolutely nothing; increase the sample rate for better resolution...
On 12/09/2010 08:56 AM, Sebastian Garth wrote:
> On Dec 8, 12:23 pm, "simwes"<olivetti81@n_o_s_p_a_m.libero.it> wrote: >> Hello everybody >> >> I am writing a code to transform an array from the frequency domain to time >> domain using the fftw. In order to increase the resolution of the signal in >> the time domain I am adding zero in the frequency before sending it to the >> fftw. >> The problem is that the signal in the time domain shifts as I add zero in >> the array in the frequency domain! I don't understand why! >> Please can someone help me? >> >> Thank you very much! > > Zero-padding buys you absolutely nothing; increase the sample rate for > better resolution...
That depends on your definition of "resolution". Doing an FFT, zero padding, then doing an IFFT is, IMHO, a valid way to do sample rate conversion in batch applications. So if the OP just meant "more time resolution, and I understand that there won't be any new information in there", then it's a valid approach. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
> > That depends on your definition of "resolution". &#4294967295;Doing an FFT, zero > padding, then doing an IFFT is, IMHO, a valid way to do sample rate > conversion in batch applications. >
I've actually read a few articles based on exactly this approach to resampling. It is valid. Clay
On Dec 9, 7:53&#4294967295;pm, Clay <c...@claysturner.com> wrote:
> > That depends on your definition of "resolution". &#4294967295;Doing an FFT, zero > > padding, then doing an IFFT is, IMHO, a valid way to do sample rate > > conversion in batch applications. > > I've actually read a few articles based on exactly this approach to > resampling. It is valid. > > Clay
It is interpolation. It is based on a model of the signal. It is valid to the extent that this model is valid. illywhacker;
On Dec 9, 3:08&#4294967295;pm, illywhacker <illywac...@gmail.com> wrote:
> On Dec 9, 7:53&#4294967295;pm, Clay <c...@claysturner.com> wrote: > > > > That depends on your definition of "resolution". &#4294967295;Doing an FFT, zero > > > padding, then doing an IFFT is, IMHO, a valid way to do sample rate > > > conversion in batch applications. > > > I've actually read a few articles based on exactly this approach to > > resampling. It is valid. > > > Clay > > It is interpolation. It is based on a model of the signal. It is valid > to the extent that this model is valid. > > illywhacker;
Yes, resampling is interpolation.
On 12/09/2010 11:53 AM, Clay wrote:
>> >> That depends on your definition of "resolution". Doing an FFT, zero >> padding, then doing an IFFT is, IMHO, a valid way to do sample rate >> conversion in batch applications. >> > > I've actually read a few articles based on exactly this approach to > resampling. It is valid.
I've used it, to satisfy a somewhat odd receiver requirement (decoding of CDMA via batch processing -- it made sense for the product, even if it was kinda odd). -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 12/09/2010 12:08 PM, illywhacker wrote:
> On Dec 9, 7:53 pm, Clay<c...@claysturner.com> wrote: >>> That depends on your definition of "resolution". Doing an FFT, zero >>> padding, then doing an IFFT is, IMHO, a valid way to do sample rate >>> conversion in batch applications. >> >> I've actually read a few articles based on exactly this approach to >> resampling. It is valid. >> >> Clay > > It is interpolation. It is based on a model of the signal. It is valid > to the extent that this model is valid.
Yup. Mathematically it's no different than using an interpolation filter -- it's just numerically efficient in some narrow circumstances. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html