help-octave
[Top][All Lists]
Advanced

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

Re: Is this correct?


From: Macy
Subject: Re: Is this correct?
Date: Fri, 25 Apr 2014 11:25:12 -0700

Brian,

When I changed the dt=1/100/fc to get finer resolution it became obvious that 
going up using my original version, the final 'frequency was indeed 500MHz and 
going down the final frequency was indeed 200MHz. so the fft's were both 
correct, it was my 'time' waveform checks that were wrong!

I had checked that time looked right, but the resolution was so poor, didn't 
notice that the frequency did go up to 500MHz! Thanks!

To correct for this, I had originally thrown in the divide by two, but did not 
understand the 'why'

2*pi()*1e6*(300+100*[0:N-1]/N/2).*t
is IDENTICAL to your form, but not 'mentally' the same.  And before dividing by 
2, was going up to a final time waveform of 500MHz! By inspection this formula 
goes up to 350MHz arrrrgggg!

By inspection, the original formula LOOKED like the frequency was only going up 
to 400MHz and with the coarse resolution confirming that it went up to 400MHz, 
well confusion all around. 

Thanks again. 

...I still don't understand quite the why my original formula ended up twice 
the other, but is ok

has to do with integrals and constants thrown in there being off by 2:1

This would be a great mind bender in a Communication's Class, eh? An example of 
where the formula 'looks' right, but isn't.



--- address@hidden wrote:

From: Brian Kaczynski <address@hidden>
To: Macy <address@hidden>
Cc: address@hidden
Subject: Re: Is this correct?
Date: Fri, 25 Apr 2014 20:22:30 +0300

The method described below is not generally the proper method for
generating FM signals.  A better method is to define a vector of increasing
phases vs. time and to change the slope of the phases to modulate
frequency.  Here is some code that might work:

fstart=300e6; fstop=400e6; dt=1/10/fc;N=120000;
t=[0:1:N-1]*dt;
ph = 2*pi*(fstart*t + 0.5*(fstop-fstart)*(t.^2)/t(end));
sig = sin(ph);

Let me know how that works!
-Brian

2014-04-25 20:11 GMT+03:00 Macy <address@hidden>:

> This is a problem 'interpretting' a swept tone in octave.
> The fft plot looks like it's too wide a spectrum.
>
> Not sure why, or what is going on here.
> The idea was to sweep from 300MHz to 400MHz: and doing so I expected ONLY
> energy in that spectral range, after all it is a slow sweep.
>
> fixed tone as a reference:
> fc=300e6;dt=1/10/fc;N=120000;
> t=[0:1:N-1]*dt;
> sig=sin(2*pi()*fc*t);
> b=fft(sig)/N;
> produces a plot with appropriate spike(s)
>
> ok now I wish to sweep the tone from 300MHz up to 400MHz
> sig=sin(2*pi()*1e6*(300+100*([0:N-1])/N).*t);
> which should make a tone sweep from 300MHz up to 400MHz, right?
> when I plotted the fft, it looked like the energy went from 300MHz up to
> 500MHz ??!!
>
> so went back and plotted
> plot(t(1:100),sig(1:100));
> hold on;
> plot(t(1:100),sig(end-100+1:end))
> hold off;
> is ok, time range held the same just for 'marking'
>
> The frequency did indeed look like 300MHz at the low end and high at the
> end, like almost 400MHz
> If go from 400MHz down to 300MHz:
> sig=sin(2*pi()*1e6*(400-100*([0:N-1])/N).*t);
> then the fft appears to go from 400MHz down to 200MHz ??!!
>
> What I'm missing is why this is NOT equivalent. the start determines an
> EXACT edge and the ending frequency becomes twice its frequency. What?
>
> The implication to me is that there is energy in those bands, else the fft
> would NOT show it. This is boggling my mind. The implication is that a low
> pass filter will act differently upon a low to high vs a high to low chirp.
> Perhaps the sweep was not as slow as I thought. something else to check.
> I'll check both premises soon, but right now I'm having difficulty wrapping
> my head about these results.
>
> Are they correct? Is this right?
>
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave
>





reply via email to

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