help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: resolution in the fft


From: Schirmacher, Rolf
Subject: RE: resolution in the fft
Date: Tue, 9 Jun 2009 21:08:08 +0200

> -----Original Message-----
> From: news [mailto:address@hidden Behalf Of Markus Feldmann
> Sent: Tuesday, June 09, 2009 8:35 PM
> To: address@hidden
> Subject: resolution in the fft
> 
> 
> Hi All,
> 
> i made a spectrum on a charge/discharge function, but i am 
> not sure how
> to raise the xscale resoultion in my spectrum.
> 
> Any ideas ?
> 
> Here comes my function:
> %Konstanten
> FS=10e6
> T1=1e-6;
> T2=2e-6;
> t1=0:1/FS:5e-6;
> t2=0:0.1e-6:10e-6;
> t=[t1,t2+t1(end)];
> U0=10;
> %charge
> u1=U0*(1-exp(-t1/T1));
> %discharge
> u2=U0*exp(-t2/T2);
> u=[u1,u2];
> subplot(2,1,1)
> plot(t,u,'-+o')
> xlabel('Time/s');
> ylabel('Voltage/V');
> grid('on')
> %FFT
> nfft= 2^(nextpow2(length(u)))
> fftu = fft(u,nfft);
> NumUniquePts = ceil((nfft+1)/2)
> fftu = fftu(1:NumUniquePts);
> mu = abs(fftu)/length(u);
> mu = mu.^2;
> if rem(nfft, 2)
>       mu(2:end) = mu(2:end)*2;
> else
>       mu(2:end -1) = mu(2:end -1)*2;
> end
> f = (0:NumUniquePts-1)*FS/nfft;
> subplot(2,1,2)
> plot(f,mu,'-+o')
> xlabel('Frequency/Hz');
> ylabel('Power');
> grid('on')
> axis([0,1e6])
> print -deps >exponential.eps
> 
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> 

I guess you mean the frequency resolution by xscale resolution. 

According to the basics of fourier analysis, you have to increase the length
of the time domain signal in order to increase the frequency resolution (and
take care of your window, of course).

And the other way around, of course: If you increase the time resolution,
you will get in addition higher frequencies.

HTH

Rolf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]