## Swept sine spectrum puzzler

## Swept sine spectrum puzzler

(OP)

I was generating a sine wave

V1out=sin(2*pi*f*t)

I wanted a sweep, so that the signal from t=1 to t=2 was 1 hz, and the signal from t=20 to t=21 is 20 Hz, etc

V2out=sin(2*pi*int(t)*t)

This gave a nasty discontinuity as the frequency changed at each second mark, so I thought I'd leave int, out.

V3out=sin(2*pi*(t)*t)

Imagine my surprise at the resulting waveform - the frequencies had doubled!

Now I'm sure this is a standard result, and I have been thinking about it for several hours, but I really cannot 'see' why the frequency should double.

Here's a few thoughts

1) sin(2*pi*f*t) goes to zero when f*t goes to zero. If the f phasor is pinning round as fast at the t phasor then the number of zeros will be greater

2) (n+1)^2 -n^2 is the number of zero crossings in the nth second of V3, whereas it is only n(n+1)-n^2 for V2

3) omega=d theta/dt

I've set omega=t*2*pi

so 2*pi*t dt = d theta

hence 1/2 *2*pi*t^2+c =theta

And that half is missing from V3 and is the cause of the frequency doubling

But I am still confused, and cannot see a good explanation why the step from V2 to V3 'needs' the 1/2

V1out=sin(2*pi*f*t)

I wanted a sweep, so that the signal from t=1 to t=2 was 1 hz, and the signal from t=20 to t=21 is 20 Hz, etc

V2out=sin(2*pi*int(t)*t)

This gave a nasty discontinuity as the frequency changed at each second mark, so I thought I'd leave int, out.

V3out=sin(2*pi*(t)*t)

Imagine my surprise at the resulting waveform - the frequencies had doubled!

Now I'm sure this is a standard result, and I have been thinking about it for several hours, but I really cannot 'see' why the frequency should double.

Here's a few thoughts

1) sin(2*pi*f*t) goes to zero when f*t goes to zero. If the f phasor is pinning round as fast at the t phasor then the number of zeros will be greater

2) (n+1)^2 -n^2 is the number of zero crossings in the nth second of V3, whereas it is only n(n+1)-n^2 for V2

3) omega=d theta/dt

I've set omega=t*2*pi

so 2*pi*t dt = d theta

hence 1/2 *2*pi*t^2+c =theta

And that half is missing from V3 and is the cause of the frequency doubling

But I am still confused, and cannot see a good explanation why the step from V2 to V3 'needs' the 1/2

Cheers

Greg Locock

## RE: Swept sine spectrum puzzler

On your number 3) if theta is the argument of the sin function then theta = 2*pi*t^2 and w(t)=dtheta/dt = 4pi t = 2*(2*pi*t). So I think the frequency is twice what your originally intended.

I'm not sure if that makes any difference to you.

I'll keep thinking about your question and see if I can understand it better (I like these kind of things).

## RE: Swept sine spectrum puzzler

So we compare two different thetas:

#1 - theta = 2pi* stairstep function * t

where stairstep function = trunc(t)

#2 - theta = 2pi * t^2

The derivative of #2 is clearly twice the derivative of #1 on any interval where it is continuous.

So the math proves that the frequency of #2 is twice the frequency of #1 (I suspect you already knew this).

And so the only remaining question is: does this make intuitive sense? I believe it does. Draw the graph of the two arguments and you will see that on any interval where #1 is continuous, #2 is rising twice as fast as #1.

But the conflict maybe comes from the fact that the value of #2 and #1 at any point in time (large time) are very close. #2 does not rise to a value for greater than #1 as t approaches infinity. How can the values of these two functions stay approximately the same when the rates of change of #2 is twice as much as #1? The answer lies in the discontinuity which provides an infinite rate of change for infinitessimally small period of time.

A lot of words. Not sure if it helps.

## RE: Swept sine spectrum puzzler

You started out with the w(t) that you wanted, integrated to obtain theta, and discovered theta was 1/2 of that in your expression (V3).

I started out with your theta from V3, too the derivative, and showed it is a factor of 2 higher than what you wanted. Same thing.

I'll make one more attempt at a concise intuitive explanation (not sure if I'm capable of that!).

Referring to my definitions #1 and #2 of the argument theta above:

A - They both "act" the same if we look only at the magnitude. The magnitudes will never be very far apart from each other.

B - They act very differently in terms of derivative. The derivative of #2 is twice the derivative of #1 on any interval where it is continuous. And it is the derivative of theta (not the magnitude) that determines the frequency.

But items A and B seem to contradict. How can two functions have the same value as t-> infinity when one of them has twice the derivative? The answer lies in the discontinutities of #1. Those are infinite derivative for infinitessimal time, which allow #1 to grow as fast as #2 even though it's derivative is one half (where continuous).

## RE: Swept sine spectrum puzzler

Instead of a staircase function with abrupt change at t=1, 2, 3, 4, you use a more real-world type function that ramps from 0 to 1 over a small time period epsilon around t=1, then ramps from t=1 to t=2 over a time period epsilon around t=2.

Now you will see extremely high frequency during the ramp period and lower frequency during the flat period.

If you compare this real-world function to the t^2 function you will now recover the same number of total zero crossings on suitably-selected interval. Half of your zero crossings associated with the idealized staircase were "hidden" at the step. You can see those hidden zero crossings appear when you broaden the step (real-world staircase).

This last argument is a little further out there than the previous. Please let me know if any of the previous has struck a chord or if there is still a mathematical or intuitive gap in my explanation.

## RE: Swept sine spectrum puzzler

The total number of zero crossings will be proportional to integral of w(t) which is in fact theta(t). The approximate number of zero crossings between t1 and t2 will be approx proportional to theta(t2) minus theta (t1). If the two theta's act similarly in magnitude (they do), then the number of zero crossings will be similar. Only when epsilon approaches zero do we lose the zero crossings.

## RE: Swept sine spectrum puzzler

The key parameter in the derivation is the total accumulated cycles. Surprisingly, the frequency function for the spectral domain differs from that of the sinusoidal argument in the time domain.

The mathematics are beyond the scope of an Email, however.

I have posted a tutorial called sweep.pdf at

http://www.vibrationdata.com/sine.htm

The tutorial gives the derivation of the sine sweep time domain function for both linear and logarithmic sweep rates.

As disclosure, a small fee is required to access the paper from the website.

Or I will send you a free copy of the paper via Email, upon request.

Sincerely, Tom Irvine

Email: tomirvine@aol.com

## RE: Swept sine spectrum puzzler

electric pete, if we're going to do these cascades we 'd better number the posts. I particularly like "One more stab at another intuitive way of looking at it (let me know when this horse has been beat to death):

Instead of a staircase function with abrupt change at t=1, 2, 3, 4, you use a more real-world type function that ramps from 0 to 1 over a small time period epsilon around t=1, then ramps from t=1 to t=2 over a time period epsilon around t=2. "....

The attraction of this explanation is that gut feeling is that using int in a time history function is a dangerous thing to do, and as you say, the implied discontinuity as the clock ticks hides a multiplicity of sins, or at least zeroes. Tom's paper may explain all, but the interesting thing is that my time based simulation model that I was running responded perfectly happily to V2 or V3, resonating at the expected frequency, at roughly t=12 for V2 and t=6 for V3. In other words, whatever the frequency domain interpretation of what is going on, the time domain response was in line with my expectations.

One other thing I noticed is that of course I am bang up hard against the Heisenberg limit, that is I am stepping the frequency by deltaf= 1/T, so I cannot expect much useful additional information in the frequency domain.

I still find myself confused, on a physical basis. If we can look at a roughly sinusoid time signal and say that roughly the frequency is half to the number of zero crossings per second, I am very confident that real world system will respond to that frequency, even if there is no sign of it in the frequency domain. (Thinking out loud: Oh ho, now I know - this is analagous to mixing two ultrasonic signals and being able to hear the intermodulation frequency.)

Well I look forward to Tom's paper and I will implement a more civilised ramping technique tonight.

Cheers

Greg Locock

## RE: Swept sine spectrum puzzler

Message # EP-6:I believe that time domain and frequency domain are in harmony if we accept the fundamental definition that:

w(t) = d/dt (theta(t))

where w(t) = instantaneous radian frequency

theta(t) = argument of sin() function

If I look back once more at your original item 3), I

believeyou were using a thought process that is not in agreement with the above defintion. Specifically, you started with the premise that omega=2*pi*t. Isurmisethat you determined this frequency to be the "coefficient" of t rather than derivative of theta in the quantity V3out=sin(2*pi*(t)*t) (where theta = 2pi*t^2)That approach (selecting the coefficient of t) works sometimes but not always. For example, if theta is something like theta=2*pi*f*t+phi then the derivative and coefficient are the same thing (2pif). Also in the case of V2 where theta=2*pi*staircase(t)*t, this approach works if we loosely consider 2*pi*staircase(t) to be the coefficient. But this approach does not work in the case of theta = 2*pi*t*t where the coefficient of t (coefficient = 2pi*t)is different than the derivative of theta (derivative = 4*pi*t). In that case the instantaneous radian frequency w(t) = d/dt(theta) = 4pi*t, not 2pi*t.

I apologize if I have misunderstood or mischaracterized your thought process.I'd like to go back and refine my second post of this thread a little. Look at two theta's:

#1 (V2) - theta = 2pi* stairstep function * t

where stairstep function = trunc(t)

#2 (V3) - theta = 2pi * t^2

For #1 the instantaneous frequency is given by 2*pi* stairstep function (not 2pi*t as I said previously). Note the value of the stairstep function is close to t but not equal. Frequency is discontinuous at points where stairstep function is discontinuous.

For #2 the instantaneous frequency is given by 2*pi*(2t), which is approx twice that of #1.