Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with fourier transform
Replies: 19   Last Post: May 27, 2009 11:24 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
alfredo

Posts: 11
Registered: 5/27/09
Re: Problem with fourier transform
Posted: May 27, 2009 4:50 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt " <xys@whatever.com> wrote in message <gvjkbs$hqb$1@fred.mathworks.com>...
> "acepsut " <acepsut@gmail.com> wrote in message <gvj28h$o91$1@fred.mathworks.com>...
> > Matt please excuse me I forgot the fourier function:
> >
> > function [Y,K]=fourier(serie,Tmax,Tmin,step)
> >
> > k=1;
> > K=Tmin:step:Tmax;
> > for X=Tmin:step:Tmax,
> > Y(k)=sum(serie.*(exp(-i*2*pi*(1./X).*(1:length(serie)))));
> > k=k+1;

>
>
> This is a bizarre looking expression for a Fourier transform. In the complex exponent you are dividing by your time axis samples?
>
> Below is the code I used and I get sensible looking peaks in the amplitude plot
>
>
> T1=90; f1=1/T1,
> T2=75; f2=1/T2,
>
>
>
>
> df=abs(f1-f2)/10,
> dt=0.01,
> N=ceil(1/dt/df),
> df=1/N/dt
>
> t_axis=dt*( -ceil((N-1)/2):N-1-ceil((N-1)/2) );
> f_axis=df*( -ceil((N-1)/2):N-1-ceil((N-1)/2) );
>
>
> f=@(T,A,phi,t) A*cos(2*pi/T*t-phi);
> Cos1=f(T1,60,2.2,ifftshift(t_axis));
> Cos2=f(T2,30,1.1,ifftshift(t_axis));
>
>
> Spectrum=fftshift( fft(Cos1+Cos2)*dt );
>
> figure(1);
>
> flim=max(f1,f2)*3;
>
>
> plot(f_axis,abs(Spectrum));
> title 'Mag Response'
> xlim([-flim flim])


Hi Matt, if I want take my signal in time domain and transform this (with fft or fourier trasform) to search which kind of frequencies are present , how can I choose the value of df ( if I don't know in my case f1 and f2)?

Best regards

Alfredo Ciclopico



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.