frequency vs time plot in matlab

Discussion in 'Programmer's Corner' started by ashish.eeiitm, Dec 18, 2009.

  1. ashish.eeiitm

    Thread Starter New Member

    Dec 18, 2009
    5
    0
    hi
    i have a sine wave with a varying frequency term, as in the f is 10 for a particular time interval and zero everywhere else.
    I want to plot the frequency vs time.

    any help on how to do the same using matlab/simulink.

    I tried using fft but i'm sure of it's working. Just used the code given in matlab help file
     
  2. ashish.eeiitm

    Thread Starter New Member

    Dec 18, 2009
    5
    0
    no reply :(

    I'll tell the complete problem just in case it helps. I have a signal with frequency 193THz - 11.3GHz -100MHz in a certain section. The rest of the section has 193THz - 11.3GHz. I need to isolate this 100MHz and to do so I superimposed it with 193 THz and then with a 11GHz after passing through low pass filters respectively. Now when I did an FFT on the resultant signal I got two peaks one at 0 and the other at 11GHz. I used the simulink filter design block and used the coefficients as the filter in my matlab code - donno if this is right but seems like the second filter is not working. I also tried using the mkfilter function but it gives me a steady state variable and conv ss object with the signal gives an error.
    Any assistance as to how to proceed further pleaseee!
     
  3. Nanophotonics

    Active Member

    Apr 2, 2009
    365
    3
    Sorry, I'm a bit rusty with Matlab.

    Post your code, maybe someone will help.
     
  4. guitarguy12387

    Active Member

    Apr 10, 2008
    359
    12
    Try plotting with fftshift() and see if that gives you what you're looking for
     
  5. ashish.eeiitm

    Thread Starter New Member

    Dec 18, 2009
    5
    0
    tried that - doesn't help much. thanks anyway.
    I'm using simulink blockset to design low pass filter with pass band 15000 and stop band 20000. I multiplied two sinusoids one with a freq of say 193550 and the other with 193550-11303-100. The output should contain 11303-100 component and 387100-11303-100 which should be filtered out when passed through the above signal. I used the filter(b,a,X) function where b is the num exported from simulink and a the denominator has coefficients all 1 and length equal to the numerator.

    Now I multiplied this resultant signal with another sinusoid of frequency 11303 and passed it through a filter with passband 1500 and stop band 2000. The output should be a sinusoid with frequency 100. FFT of this signal should give two peaks - one at 0 and the other at 100. But I'm getting peaks at 0 and 11303.

    I donno if my implementation of filter is right or not? Matlab help is clearly not helping me much. any help is appreciated. thanks in advance. :)
     
Loading...