From: Bruno Luong on
"RSK " <kalerahul(a)yahoo.com> wrote in message <hvc7ta$l1i$1(a)fred.mathworks.com>...

>
> 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?

Let me reiterate: no when you pad zero the spectrum changes globally, because you introduce a JUMP in your data, which has a spectrum decreasing slowly ~1/f. For example or constant function (which has a dirac spectrum) becomes a Heaviside function, and the fft becomes the damped oscillation:

a=ones(1,100);
subplot(2,1,1);
plot(real(fft(a)))

a(128)=0; % pad 0
subplot(2,1,2);
plot(real(fft(a)))

Bruno
From: RSK on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hvcf8c$qg8$1(a)fred.mathworks.com>...
> "RSK " <kalerahul(a)yahoo.com> wrote in message <hvc7ta$l1i$1(a)fred.mathworks.com>...
>
> >
> > 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?
>
> Let me reiterate: no when you pad zero the spectrum changes globally, because you introduce a JUMP in your data, which has a spectrum decreasing slowly ~1/f. For example or constant function (which has a dirac spectrum) becomes a Heaviside function, and the fft becomes the damped oscillation:
>
> a=ones(1,100);
> subplot(2,1,1);
> plot(real(fft(a)))
>
> a(128)=0; % pad 0
> subplot(2,1,2);
> plot(real(fft(a)))
>
> Bruno


Thanks...Bruno
From: RSK on
"RSK " <kalerahul(a)yahoo.com> wrote in message <hvckkb$5r8$1(a)fred.mathworks.com>...
> "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hvcf8c$qg8$1(a)fred.mathworks.com>...
> > "RSK " <kalerahul(a)yahoo.com> wrote in message <hvc7ta$l1i$1(a)fred.mathworks.com>...
> >
> > >
> > > 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?
> >
> > Let me reiterate: no when you pad zero the spectrum changes globally, because you introduce a JUMP in your data, which has a spectrum decreasing slowly ~1/f. For example or constant function (which has a dirac spectrum) becomes a Heaviside function, and the fft becomes the damped oscillation:
> >
> > a=ones(1,100);
> > subplot(2,1,1);
> > plot(real(fft(a)))
> >
> > a(128)=0; % pad 0
> > subplot(2,1,2);
> > plot(real(fft(a)))
> >
> > Bruno
>
>
> Thanks...Bruno

Bruno,

I just checked with a simple signal construction(half sine)

deltat=1/800;
t=0:deltat:1-deltat;
y=sin(.5*t*2*3.142);
z=fft(y,800)/800; % fft using one period
f1 = 800/2*linspace(0,1,400);
plot(f1,2*abs(z(1:400)));grid on;hold on;
z8=[y zeros(1,4096-800)]; % signal using zero padding upto 4096
f6 = 800/2*linspace(0,1,2048);
z9=fft(z8,4096)/800; % fft using zero padding upto 4096
plot(f6,2*abs(z9(1:2048)));

y1=repmat(y,1,5); % copy upto 5 periods
z10=fft(y1,4000)/4000;
f10=800/2*linspace(0,1,2000);
plot(f10,2*abs(z10(1:2000)));

Why do plots of z10 and z9 differ? I was expecting z9 to follow z10 approximately at the intermediate frequencies too. Did I do something wrong?

Thanks
RSK
First  |  Prev  | 
Pages: 1 2 3
Prev: perpendiculars
Next: Output for svmclassify