help-octave
[Top][All Lists]
Advanced

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

Re: FFT in Octave


From: Mike Miller
Subject: Re: FFT in Octave
Date: Wed, 24 Jul 2013 23:09:04 -0400

Hi, please reply all to include the mailing list in your response so
others can benefit from the discussion.

On Wed, Jul 24, 2013 at 23:32:01 +0100, DECROP Fabrice wrote:
> Hi,
>
> First, I want to thank you for your answer !!!
>
> In fact, I don't understand why I get a CW signal around 70, even if it's
> 700/10, because I'm sampling at 10 and I set 700 points to my graph.
>
> Shouldn't I expect a CW carrier à 144,425*10^(6), because it's the frequency
> I set in my sinus function written in generate_CW_A1A ? I'm thinking as an
> RF engineer, and I'm waiting to see what I see on an spectrum analyser.
>
> I feel really confused with the samplig rate and number of point setting
> wich set the carrier frequency I see on the graph, whatever the real
> frequency is used in my signal generation.

What you are plotting is just discrete data points in the frequency
domain and you have not given the fft or plot routines any knowledge
of what the absolute RF or sampling rate are. In fact, if you reduce
the math in your generate_cw_A1A function, you'll see that rf_out only
really depends on the constant ratio 1/10.

More generally, when plotting a single vector in Octave, the x-axis
always represents simply the unitless index. If you want to give the
x-axis some meaningful values, absolute RF frequency in Hz in this
case, you have to use the plot(x,y) form of the plot function. This is
why I suggested

  f = linspace (0, 10*f_F5ZAM, numel(dsp_rf_out));
  plot (f, 20*log10 (dsp_rf_out))

You might also want to look at the pwelch function which may be more
suitable than a simple fft to what you are trying to do, and can also
do the plotting for you.

HTH,

-- 
mike


reply via email to

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