I have currently written a piece of code that applies a mathematical formula to an input signal and then plots the result.
The original input was just a single cycle of a cosine wave expressed in a set of values in degrees from 0 to 360 and then displayed as a column vector. This allowed me to make sure that the code worked and that I could plot the results from the equation to what was expected. The following is the code that I have started with:
input = [0;15;30;45;60;75;90;105;120;135;150;165;180;195;210;225;240;255;270;285;300;315;330;345;360];
u = cosd (input);
s = 1;
Osat1 = 0.5;
Osat2 = 1.5;
Fam1 = u./((1+(u./Osat1).^(2*s)).^(1/(2*s)));
title('Plots of Osat=0.5 and Osat=1.5')
Fam2 = u./((1+(u./Osat2).^(2*s)).^(1/(2*s)));
I now need to look at how this formula works when a more representative input signal is applied of say 1 kHz.
Unfortunately I can't figure out how to input the signal as a 1 kHz cosine wave whilst also being able to plot this against the results of the model equation. Just repeating the string of numbers 1000 times using the repmat command does not work as this just still plots the single cycle from 0 to 360. I would like to see how the values of Osat1 and Osat2 behave over a larger number of cycles.
Any help on this would be much appreciated.