From: Wayne King on
"RSK " <kalerahul(a)yahoo.com> wrote in message <hvaep7$2vv$1(a)fred.mathworks.com>...
> "Wayne King" <wmkingty(a)gmail.com> wrote in message <hvacpi$qkj$1(a)fred.mathworks.com>...
> > "RSK " <kalerahul(a)yahoo.com> wrote in message <hvab18$77n$1(a)fred.mathworks.com>...
> > > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hva8qf$lrf$1(a)fred.mathworks.com>...
> > > > "RSK " <kalerahul(a)yahoo.com> wrote in message <hv9o1n$nf0$1(a)fred.mathworks.com>...
> > > > > Are these two signals same with respect to frequency spectrum? one is zero padded and one has two cycles. If zero padding would just add interpolated points in the original spectrum, then would the spectrum for both of these same?
> > > > >
> > > > > Signal 1 (zero padded after first cycle)
> > > > >
> > > > > Time Amplitude
> > > > > 0 0
> > > > > 1 1
> > > > > 2 0
> > > > > 3 0
> > > > > 4 0
> > > > > 5 0
> > > > >
> > > > > Signal 2 (two cycles)
> > > > >
> > > > >
> > > > > Time Amplitude
> > > > > 0 0
> > > > > 1 1
> > > > > 2 0
> > > > > 3 0
> > > > > 4 1
> > > > > 5 0
> > > >
> > > > Hi, I don't see how the second signal is two cycles of the first signal. Maybe I'm not identifying your signal correctly since you have it in matrix form, but it appears to me you are calling the signal (Signal 1):
> > > >
> > > > x= [0 0
> > > > 1 1
> > > > 2 0
> > > > 3 0
> > > > 4 0
> > > > 5 0];
> > > > x = reshape(x,12,1);
> > > >
> > > > % 0 1 2 3 4 5 0 1 0 0 0 0
> > > >
> > > > What is the signal before the zero padding?
> > > > [0 1 2 3 4 5 0 1] ?
> > > >
> > > > In which case, if the second signal were two cycles of that, it would be
> > > >
> > > > x = [0 1 2 3 4 5 0 1];
> > > > x1 = repmat(x,1,2);
> > > >
> > > > Note the following:
> > > >
> > > > % 6 cycles of a 1/10 Hz wave
> > > > x = cos(2*pi*(1/10)*(0:59)');
> > > > % zero pad out an additional 4 cycles
> > > > x = [x; zeros(40,1)];
> > > > % 10 cycles of 1/10 Hz wave
> > > > x1 = cos(2*pi*(1/10)*(0:99)');
> > > > % plot their magnitude spectrums
> > > > plot(abs(fft(x)),'k'); hold on;
> > > > plot(abs(fft(x1)),'b');
> > > > legend('zero padded','not padded','location','north');
> > > >
> > > > Wayne
> > >
> > > Wayne,
> > >
> > > The first column is time and second is amplitude. The two signals have triangle with peak amplitude 1.
> >
> > Hi, Sorry, my fault. I somehow read right past the amplitude-time labels, I see now that was clear. I think maybe your example isn't the best comparison since you only have one period of your waveform [0 1 0]. A spectral estimate of one period of any waveform isn't going to be very good. You need a few periods. So let's construct a few periods of your triangle waveform.
> >
> > % ten periods of your waveform
> > x = [0 1 0];
> > x1 = repmat(x,1,10);
> > % zero pad it out to a length of 20 periods
> > x1 =[x1 zeros(1,30)];
> >
> > % 20 periods no zero padding
> > x2 = repmat(x,1,20);
> > plot(abs(fftshift(fft(x1))),'k'); hold on;
> > plot(abs(fftshift(fft(x2))),'b');
> > legend('zero padded','not padded','location','north');
> >
> > Note that the spectra are not the same, but if you are using the spectrum as a way of identifying oscillations in a signal, then both agree in their identification of the peaks.
> >
> > Wayne
>
>
> Wayne,
>
> Thank you much for working it out for me. Actually, I am trying to understand why people say that zero padding just interpolates and does not add any other information. In this example, the blue curve is quite different than the green. This is exactly what I want to know. If the two signals are the forces measured at a point on the structure and if I need to find response due to these forces, using either of the curves as an input force would give different output compared to the other.
> Conside a case in which I measure only 10 periods of the force waveform and zeropad it wth another 20 periods as you have done. By doing this, I am going to create spurious forces at the other frequencies which would not apprear if I had acquired 30 periods of waveform.
> For me then, the zero padding proves detrimental as it is producing peaks at other frequencies and it will eventually generate structural response at those frequencies which would be a 'false' response.
>
> Not sure if I am making myself clear.
>
> Any comments?
>
> In summary, I want to know if any 'physical' waveform(like force, displacement etc) can be zero padded to any lenght without affecting the outcome. This is generally encountered when we acquire data less than the next power of two( I mean, say 1500 samples instead of 2048)
>
> Thanks
>
> RSK

Hi, I think people are right to say that it doesn't add information and just interpolates the discrete frequency grid. I would say think about it this way. If you are doing a spectral analysis, the more periods you have of an oscillation, the easier any Fourier-transform-based tool is going to be at identifying those oscillations. It sounds like your application is a spectral analysis of a random process. These processes may have deterministic oscillations that you are trying to identify, but the signal will always be corrupted by noise. So you will be forced to deal with an estimate of the true spectrum of the process. Whether or not "peaks" you see in the spectral estimate are true "peaks" or spurious is a decision you can only reach statistically. There are many techniques available for these hypothesis tests depending on what kind of assumptions you can reasonably make about the
random process. I think a really good reference is the book by Percival and Walden, "Spectral Analysis for Physical Applications".

Also, I would note that when doing spectral analysis, it is common to use a dB scale because taking the logarithm is a variance-stabilizing transformation. You can see that constructing spectral estimates using a dB scale changes the picture a bit between the zero-padded and non-padded signals.


x = [0 1 0];
x1 = repmat(x,1,10);
% zero pad it out to a length of 20 periods
x1 =[x1 zeros(1,30)];
% 20 periods no zero padding
x2 = repmat(x,1,20);
% Periodogram estimates
plot(psd(spectrum.periodogram('Hamming'),detrend(x1)));
figure;
plot(psd(spectrum.periodogram('Hamming'),detrend(x2)));

% Here is a multitaper technique
% Multitaper estimate
plot(psd(spectrum.mtm(2.5),detrend(x1)));
figure;
plot(psd(spectrum.mtm(2.5),detrend(x2)));

I still think in both cases you would correctly identify the peak of interest. But again, this should be done with a hypothesis test.

Wayne
From: RSK on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hvah0i$nl3$1(a)fred.mathworks.com>...
> "RSK " <kalerahul(a)yahoo.com> wrote in message <hvaep7$2vv$1(a)fred.mathworks.com>...
> > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hvacpi$qkj$1(a)fred.mathworks.com>...
> > > "RSK " <kalerahul(a)yahoo.com> wrote in message <hvab18$77n$1(a)fred.mathworks.com>...
> > > > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hva8qf$lrf$1(a)fred.mathworks.com>...
> > > > > "RSK " <kalerahul(a)yahoo.com> wrote in message <hv9o1n$nf0$1(a)fred.mathworks.com>...
> > > > > > Are these two signals same with respect to frequency spectrum? one is zero padded and one has two cycles. If zero padding would just add interpolated points in the original spectrum, then would the spectrum for both of these same?
> > > > > >
> > > > > > Signal 1 (zero padded after first cycle)
> > > > > >
> > > > > > Time Amplitude
> > > > > > 0 0
> > > > > > 1 1
> > > > > > 2 0
> > > > > > 3 0
> > > > > > 4 0
> > > > > > 5 0
> > > > > >
> > > > > > Signal 2 (two cycles)
> > > > > >
> > > > > >
> > > > > > Time Amplitude
> > > > > > 0 0
> > > > > > 1 1
> > > > > > 2 0
> > > > > > 3 0
> > > > > > 4 1
> > > > > > 5 0
> > > > >
> > > > > Hi, I don't see how the second signal is two cycles of the first signal. Maybe I'm not identifying your signal correctly since you have it in matrix form, but it appears to me you are calling the signal (Signal 1):
> > > > >
> > > > > x= [0 0
> > > > > 1 1
> > > > > 2 0
> > > > > 3 0
> > > > > 4 0
> > > > > 5 0];
> > > > > x = reshape(x,12,1);
> > > > >
> > > > > % 0 1 2 3 4 5 0 1 0 0 0 0
> > > > >
> > > > > What is the signal before the zero padding?
> > > > > [0 1 2 3 4 5 0 1] ?
> > > > >
> > > > > In which case, if the second signal were two cycles of that, it would be
> > > > >
> > > > > x = [0 1 2 3 4 5 0 1];
> > > > > x1 = repmat(x,1,2);
> > > > >
> > > > > Note the following:
> > > > >
> > > > > % 6 cycles of a 1/10 Hz wave
> > > > > x = cos(2*pi*(1/10)*(0:59)');
> > > > > % zero pad out an additional 4 cycles
> > > > > x = [x; zeros(40,1)];
> > > > > % 10 cycles of 1/10 Hz wave
> > > > > x1 = cos(2*pi*(1/10)*(0:99)');
> > > > > % plot their magnitude spectrums
> > > > > plot(abs(fft(x)),'k'); hold on;
> > > > > plot(abs(fft(x1)),'b');
> > > > > legend('zero padded','not padded','location','north');
> > > > >
> > > > > Wayne
> > > >
> > > > Wayne,
> > > >
> > > > The first column is time and second is amplitude. The two signals have triangle with peak amplitude 1.
> > >
> > > Hi, Sorry, my fault. I somehow read right past the amplitude-time labels, I see now that was clear. I think maybe your example isn't the best comparison since you only have one period of your waveform [0 1 0]. A spectral estimate of one period of any waveform isn't going to be very good. You need a few periods. So let's construct a few periods of your triangle waveform.
> > >
> > > % ten periods of your waveform
> > > x = [0 1 0];
> > > x1 = repmat(x,1,10);
> > > % zero pad it out to a length of 20 periods
> > > x1 =[x1 zeros(1,30)];
> > >
> > > % 20 periods no zero padding
> > > x2 = repmat(x,1,20);
> > > plot(abs(fftshift(fft(x1))),'k'); hold on;
> > > plot(abs(fftshift(fft(x2))),'b');
> > > legend('zero padded','not padded','location','north');
> > >
> > > Note that the spectra are not the same, but if you are using the spectrum as a way of identifying oscillations in a signal, then both agree in their identification of the peaks.
> > >
> > > Wayne
> >
> >
> > Wayne,
> >
> > Thank you much for working it out for me. Actually, I am trying to understand why people say that zero padding just interpolates and does not add any other information. In this example, the blue curve is quite different than the green. This is exactly what I want to know. If the two signals are the forces measured at a point on the structure and if I need to find response due to these forces, using either of the curves as an input force would give different output compared to the other.
> > Conside a case in which I measure only 10 periods of the force waveform and zeropad it wth another 20 periods as you have done. By doing this, I am going to create spurious forces at the other frequencies which would not apprear if I had acquired 30 periods of waveform.
> > For me then, the zero padding proves detrimental as it is producing peaks at other frequencies and it will eventually generate structural response at those frequencies which would be a 'false' response.
> >
> > Not sure if I am making myself clear.
> >
> > Any comments?
> >
> > In summary, I want to know if any 'physical' waveform(like force, displacement etc) can be zero padded to any lenght without affecting the outcome. This is generally encountered when we acquire data less than the next power of two( I mean, say 1500 samples instead of 2048)
> >
> > Thanks
> >
> > RSK
>
> Hi, I think people are right to say that it doesn't add information and just interpolates the discrete frequency grid. I would say think about it this way. If you are doing a spectral analysis, the more periods you have of an oscillation, the easier any Fourier-transform-based tool is going to be at identifying those oscillations. It sounds like your application is a spectral analysis of a random process. These processes may have deterministic oscillations that you are trying to identify, but the signal will always be corrupted by noise. So you will be forced to deal with an estimate of the true spectrum of the process. Whether or not "peaks" you see in the spectral estimate are true "peaks" or spurious is a decision you can only reach statistically. There are many techniques available for these hypothesis tests depending on what kind of assumptions you can reasonably make about the
> random process. I think a really good reference is the book by Percival and Walden, "Spectral Analysis for Physical Applications".
>
> Also, I would note that when doing spectral analysis, it is common to use a dB scale because taking the logarithm is a variance-stabilizing transformation. You can see that constructing spectral estimates using a dB scale changes the picture a bit between the zero-padded and non-padded signals.
>
>
> x = [0 1 0];
> x1 = repmat(x,1,10);
> % zero pad it out to a length of 20 periods
> x1 =[x1 zeros(1,30)];
> % 20 periods no zero padding
> x2 = repmat(x,1,20);
> % Periodogram estimates
> plot(psd(spectrum.periodogram('Hamming'),detrend(x1)));
> figure;
> plot(psd(spectrum.periodogram('Hamming'),detrend(x2)));
>
> % Here is a multitaper technique
> % Multitaper estimate
> plot(psd(spectrum.mtm(2.5),detrend(x1)));
> figure;
> plot(psd(spectrum.mtm(2.5),detrend(x2)));
>
> I still think in both cases you would correctly identify the peak of interest. But again, this should be done with a hypothesis test.
>
> Wayne


Wayne,

Thanks for your inputs. The signal I am dealing with is a deterministic one. However, it has a sample size that is not in powers of two as explained above. I use the fft of this signal to get the response of a structure to this input signal. The response calculation is done "frequency by frequency" by using a transfer function that multiplies this fft. Now, if the peaks at some frequency in the frequency domain are actually not actually there in the time signal but they appear due to artifacts produced by zero padding, it is naturally going to affect my response calculations.
Would you like to comment on the zero padding keeping this in mind?
Talking about interpolation, in your example too, did you mean that the peaks in the green signal were also there in the blue one(but invisible)? I feel that, as the two signals were different, there spectrums are different and that is it. I am still unable to understand if it is appropriate to add zeros in my case(I mean when I have a signal with 1500 samples and I make it 2048 by adding zeros)

Thanks

RSK
From: Wayne King on
"RSK " <kalerahul(a)yahoo.com> wrote in message <hvai6j$b2q$1(a)fred.mathworks.com>...
> "Wayne King" <wmkingty(a)gmail.com> wrote in message <hvah0i$nl3$1(a)fred.mathworks.com>...
> > "RSK " <kalerahul(a)yahoo.com> wrote in message <hvaep7$2vv$1(a)fred.mathworks.com>...
> > > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hvacpi$qkj$1(a)fred.mathworks.com>...
> > > > "RSK " <kalerahul(a)yahoo.com> wrote in message <hvab18$77n$1(a)fred.mathworks.com>...
> > > > > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hva8qf$lrf$1(a)fred.mathworks.com>...
> > > > > > "RSK " <kalerahul(a)yahoo.com> wrote in message <hv9o1n$nf0$1(a)fred.mathworks.com>...
> > > > > > > Are these two signals same with respect to frequency spectrum? one is zero padded and one has two cycles. If zero padding would just add interpolated points in the original spectrum, then would the spectrum for both of these same?
> > > > > > >
> > > > > > > Signal 1 (zero padded after first cycle)
> > > > > > >
> > > > > > > Time Amplitude
> > > > > > > 0 0
> > > > > > > 1 1
> > > > > > > 2 0
> > > > > > > 3 0
> > > > > > > 4 0
> > > > > > > 5 0
> > > > > > >
> > > > > > > Signal 2 (two cycles)
> > > > > > >
> > > > > > >
> > > > > > > Time Amplitude
> > > > > > > 0 0
> > > > > > > 1 1
> > > > > > > 2 0
> > > > > > > 3 0
> > > > > > > 4 1
> > > > > > > 5 0
> > > > > >
> > > > > > Hi, I don't see how the second signal is two cycles of the first signal. Maybe I'm not identifying your signal correctly since you have it in matrix form, but it appears to me you are calling the signal (Signal 1):
> > > > > >
> > > > > > x= [0 0
> > > > > > 1 1
> > > > > > 2 0
> > > > > > 3 0
> > > > > > 4 0
> > > > > > 5 0];
> > > > > > x = reshape(x,12,1);
> > > > > >
> > > > > > % 0 1 2 3 4 5 0 1 0 0 0 0
> > > > > >
> > > > > > What is the signal before the zero padding?
> > > > > > [0 1 2 3 4 5 0 1] ?
> > > > > >
> > > > > > In which case, if the second signal were two cycles of that, it would be
> > > > > >
> > > > > > x = [0 1 2 3 4 5 0 1];
> > > > > > x1 = repmat(x,1,2);
> > > > > >
> > > > > > Note the following:
> > > > > >
> > > > > > % 6 cycles of a 1/10 Hz wave
> > > > > > x = cos(2*pi*(1/10)*(0:59)');
> > > > > > % zero pad out an additional 4 cycles
> > > > > > x = [x; zeros(40,1)];
> > > > > > % 10 cycles of 1/10 Hz wave
> > > > > > x1 = cos(2*pi*(1/10)*(0:99)');
> > > > > > % plot their magnitude spectrums
> > > > > > plot(abs(fft(x)),'k'); hold on;
> > > > > > plot(abs(fft(x1)),'b');
> > > > > > legend('zero padded','not padded','location','north');
> > > > > >
> > > > > > Wayne
> > > > >
> > > > > Wayne,
> > > > >
> > > > > The first column is time and second is amplitude. The two signals have triangle with peak amplitude 1.
> > > >
> > > > Hi, Sorry, my fault. I somehow read right past the amplitude-time labels, I see now that was clear. I think maybe your example isn't the best comparison since you only have one period of your waveform [0 1 0]. A spectral estimate of one period of any waveform isn't going to be very good. You need a few periods. So let's construct a few periods of your triangle waveform.
> > > >
> > > > % ten periods of your waveform
> > > > x = [0 1 0];
> > > > x1 = repmat(x,1,10);
> > > > % zero pad it out to a length of 20 periods
> > > > x1 =[x1 zeros(1,30)];
> > > >
> > > > % 20 periods no zero padding
> > > > x2 = repmat(x,1,20);
> > > > plot(abs(fftshift(fft(x1))),'k'); hold on;
> > > > plot(abs(fftshift(fft(x2))),'b');
> > > > legend('zero padded','not padded','location','north');
> > > >
> > > > Note that the spectra are not the same, but if you are using the spectrum as a way of identifying oscillations in a signal, then both agree in their identification of the peaks.
> > > >
> > > > Wayne
> > >
> > >
> > > Wayne,
> > >
> > > Thank you much for working it out for me. Actually, I am trying to understand why people say that zero padding just interpolates and does not add any other information. In this example, the blue curve is quite different than the green. This is exactly what I want to know. If the two signals are the forces measured at a point on the structure and if I need to find response due to these forces, using either of the curves as an input force would give different output compared to the other.
> > > Conside a case in which I measure only 10 periods of the force waveform and zeropad it wth another 20 periods as you have done. By doing this, I am going to create spurious forces at the other frequencies which would not apprear if I had acquired 30 periods of waveform.
> > > For me then, the zero padding proves detrimental as it is producing peaks at other frequencies and it will eventually generate structural response at those frequencies which would be a 'false' response.
> > >
> > > Not sure if I am making myself clear.
> > >
> > > Any comments?
> > >
> > > In summary, I want to know if any 'physical' waveform(like force, displacement etc) can be zero padded to any lenght without affecting the outcome. This is generally encountered when we acquire data less than the next power of two( I mean, say 1500 samples instead of 2048)
> > >
> > > Thanks
> > >
> > > RSK
> >
> > Hi, I think people are right to say that it doesn't add information and just interpolates the discrete frequency grid. I would say think about it this way. If you are doing a spectral analysis, the more periods you have of an oscillation, the easier any Fourier-transform-based tool is going to be at identifying those oscillations. It sounds like your application is a spectral analysis of a random process. These processes may have deterministic oscillations that you are trying to identify, but the signal will always be corrupted by noise. So you will be forced to deal with an estimate of the true spectrum of the process. Whether or not "peaks" you see in the spectral estimate are true "peaks" or spurious is a decision you can only reach statistically. There are many techniques available for these hypothesis tests depending on what kind of assumptions you can reasonably make about the
> > random process. I think a really good reference is the book by Percival and Walden, "Spectral Analysis for Physical Applications".
> >
> > Also, I would note that when doing spectral analysis, it is common to use a dB scale because taking the logarithm is a variance-stabilizing transformation. You can see that constructing spectral estimates using a dB scale changes the picture a bit between the zero-padded and non-padded signals.
> >
> >
> > x = [0 1 0];
> > x1 = repmat(x,1,10);
> > % zero pad it out to a length of 20 periods
> > x1 =[x1 zeros(1,30)];
> > % 20 periods no zero padding
> > x2 = repmat(x,1,20);
> > % Periodogram estimates
> > plot(psd(spectrum.periodogram('Hamming'),detrend(x1)));
> > figure;
> > plot(psd(spectrum.periodogram('Hamming'),detrend(x2)));
> >
> > % Here is a multitaper technique
> > % Multitaper estimate
> > plot(psd(spectrum.mtm(2.5),detrend(x1)));
> > figure;
> > plot(psd(spectrum.mtm(2.5),detrend(x2)));
> >
> > I still think in both cases you would correctly identify the peak of interest. But again, this should be done with a hypothesis test.
> >
> > Wayne
>
>
> Wayne,
>
> Thanks for your inputs. The signal I am dealing with is a deterministic one. However, it has a sample size that is not in powers of two as explained above. I use the fft of this signal to get the response of a structure to this input signal. The response calculation is done "frequency by frequency" by using a transfer function that multiplies this fft. Now, if the peaks at some frequency in the frequency domain are actually not actually there in the time signal but they appear due to artifacts produced by zero padding, it is naturally going to affect my response calculations.
> Would you like to comment on the zero padding keeping this in mind?
> Talking about interpolation, in your example too, did you mean that the peaks in the green signal were also there in the blue one(but invisible)? I feel that, as the two signals were different, there spectrums are different and that is it. I am still unable to understand if it is appropriate to add zeros in my case(I mean when I have a signal with 1500 samples and I make it 2048 by adding zeros)
>
> Thanks
>
> RSK

Hi, Consider this example:

f1 = 10/128; f2 = 20/128;
x = cos(2*pi*f1*(0:79)')+0.5*sin(2*pi*f2*(0:79)');


The frequencies are 10/128 and 20/128, but the signal is 80 points long, so the Fourier transform is estimated at frequencies which are multiples of 1/80 with :

plot(abs(fft(x))); grid on;

Note that the amplitude ratio isn't right. The ratio should be two. Now zero pad out to 128

figure;
plot(abs(fft(x,128))); grid on;

Now look at the ratio of magnitudes. It's much closer to the expected 2. That's because in this concocted example, you've zero padded to a grid where the frequencies, f1 and f2, fall on discrete Fourier bins.

So I think there's two reasons to zero pad. One reason is the one shown above. The other reason is algorithmic and has to do a fast Fourier transform implementation of the discrete Fourier transform. I'm no expert on the algorithm question. There are a lot of people on this forum, Bruno Luong for one, who know a lot about the algorithm question. There are fft algorithms that don't require a power of two signal. Obviously Matlab uses these when the signal is not a power of two. I'm not sure whether requiring a power of two is antiquated at this point because non-radix-2 algorithms have progressed to a point where you don't get any computational advantage any more from a radix-2 FFT. Again, I leave that for Bruno and others to weigh in on. I know that embedded Matlab only supports power of two signal lengths.

For my part, I've never been working in an area where a power of two was necessary. So I think you should ask yourself whether in your situation you need to pad your signal at all.

Wayne
From: Bruno Luong on
> > > >
> > > > Thank you much for working it out for me. Actually, I am trying to understand why people say that zero padding just interpolates and does not add any other information. In this example, the blue curve is quite different than the green.

This statement is not true if the data is not properly windowing (such as hamming window).

>This is exactly what I want to know. If the two signals are the forces measured at a point on the structure and if I need to find response due to these forces, using either of the curves as an input force would give different output compared to the other.
> > > > Conside a case in which I measure only 10 periods of the force waveform and zeropad it wth another 20 periods as you have done. By doing this, I am going to create spurious forces at the other frequencies which would not apprear if I had acquired 30 periods of waveform.
> > > > For me then, the zero padding proves detrimental as it is producing peaks at other frequencies and it will eventually generate structural response at those frequencies which would be a 'false' response.
> > > >
> > > > Not sure if I am making myself clear.
> > > >
> > > > Any comments?
> > > >
> > > > In summary, I want to know if any 'physical' waveform(like force, displacement etc) can be zero padded to any lenght without affecting the outcome. This is generally encountered when we acquire data less than the next power of two( I mean, say 1500 samples instead of 2048)

Wayne is correct, People usually pad zeros to data up to next power two mainly for speed, because FFT algorithm works optimally in this configuration.

Frequency spectrum is better estimated with proper windowing rather than zero padding.

Bruno
From: RSK on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hvbf2c$fcr$1(a)fred.mathworks.com>...
> > > > >
> > > > > Thank you much for working it out for me. Actually, I am trying to understand why people say that zero padding just interpolates and does not add any other information. In this example, the blue curve is quite different than the green.
>
> This statement is not true if the data is not properly windowing (such as hamming window).


Bruno,
Your statement was, "This statement is not true if the data is not properly windowing (such as hamming window)."
Can you elaborate on this? Did you mean zero padding might give different spectrum if the data is not windowed? why would you need window when the ends are zero(by zero padding)



>
> >This is exactly what I want to know. If the two signals are the forces measured at a point on the structure and if I need to find response due to these forces, using either of the curves as an input force would give different output compared to the other.
> > > > > Conside a case in which I measure only 10 periods of the force waveform and zeropad it wth another 20 periods as you have done. By doing this, I am going to create spurious forces at the other frequencies which would not apprear if I had acquired 30 periods of waveform.
> > > > > For me then, the zero padding proves detrimental as it is producing peaks at other frequencies and it will eventually generate structural response at those frequencies which would be a 'false' response.
> > > > >
> > > > > Not sure if I am making myself clear.
> > > > >
> > > > > Any comments?
> > > > >
> > > > > In summary, I want to know if any 'physical' waveform(like force, displacement etc) can be zero padded to any lenght without affecting the outcome. This is generally encountered when we acquire data less than the next power of two( I mean, say 1500 samples instead of 2048)
>
> Wayne is correct, People usually pad zeros to data up to next power two mainly for speed, because FFT algorithm works optimally in this configuration.
>
> Frequency spectrum is better estimated with proper windowing rather than zero padding.
>

Windows are used just to make ends zero, correct? do you think that if I zero pad a signal to any length, its spectrum will just give interpolated values in the base signal spectrum(obtained without zero padding) ? or should it be treated as entirely different spectrum?
This is vital for me to understand because the spectrum that I use decides the response in frequency domain. All calculations are being done in frequency domain.
Thanks
RSK

> Bruno
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: perpendiculars
Next: Output for svmclassify