Hi all
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]; %input signal
u = cosd (input); %magnitude value in RAPP model equation
s = 1; %smoothness factor
Osat1 = 0.5; %output saturation factor 1
Osat2 = 1.5; %output saturation factor 2
Fam1 = u./((1+(u./Osat1).^(2*s)).^(1/(2*s))); %RAPP model equation
plot(input,Fam1)title('Plots of Osat=0.5 and Osat=1.5')hold onFam2 = u./((1+(u./Osat2).^(2*s)).^(1/(2*s))); %RAPP model equationplot(input,Fam2)hold off
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.
Cheers
Dan
Best Answer