2

I'd like to create a sine wave with an increasing frequency, my approach was is as follows:

Simulink diagram

And this is the result:

Result

Now, the frequency is increasing, but it increases too much. After 1 sec, though, it has the final and right frequency. Hope you can help, I've got no idea why there the frequency increases too much!!

Thanks very much!

Tom Fuller
  • 5,291
  • 7
  • 33
  • 42
tenneck
  • 21
  • 1
  • 2
  • 1
    The frecuency increases with the ramp, so make the slope of the ramp smaller. Also, I realise you have no idea what your code is doing (probably not your code). Please, sit down and try to understand it – Ander Biguri Nov 23 '16 at 17:29
  • Well, it is my code in fact and I know how it works. The ramp increases w and I get the time from the simulation, which is a ramp as well. Since the sine wave depends on w - sin(wt) - the highest frequency should be reached when w is the greatest. But it's not and that is what I don't understand... – tenneck Nov 23 '16 at 17:41
  • Yes...... and `w` stops increasing at `t=1` which is what you see. Whats the question again – Ander Biguri Nov 23 '16 at 18:07
  • I would like a sine wave which increases the frequency from 0 to 25 Hz and then stays at 25 Hz. But in this example the frequency increases to much more than 25 Hz within the first second. After one second it drops back to the final frequency of 25 Hz. – tenneck Nov 23 '16 at 18:10

2 Answers2

2

You could just use the chirp-signal block:

enter image description here

Robert Seifert
  • 25,078
  • 11
  • 68
  • 113
1

If you read this article, You would know the final frequency of your chirp signal is 50Hz.

According to the equation of linear chirp signal, in order to get 25Hz as final frequency, 0.5 has to be multiplied to sin input of your chirp signal, before 1 second.

After one second, your signal would be pure 25Hz sin signal, but the phase would be different with previous chirp signal.

Since interval of your chirp signal is just 1 second, if you subtract 'final frequency*pi' from sin input, you can match the phase difference.

Below is the sample simulink blocks you might want to do.

enter image description here

The result plot is below.

enter image description here

KKS
  • 1,389
  • 1
  • 14
  • 33