I have some working code that does amplitude modulation and plots it.
However I’m trying to change the way the modulation looks (the y variable)
so it looks like an egg shape. I found an equation/website that looks good
http://www16.ocn.ne.jp/~akiko-y/Egg/index_egg_E.html
but I’m not to sure how to convert that into matlab/octave code to change the y variable
%test_amplitude modultaion
fs=1000;
t=linspace(0,2*pi,fs);
mt=1*sin(100*t); %signal you want to use
y=mt.*(1+cos(1*t+pi));%modulation equation, use pi to shift over 90 deg to start at 0
y=y';
y_norm=(y(:,1)/max(abs(y(:,1)))*.8); %normalize signal
plot(y_norm)
PS: this is matlab/octave code
Using the equations given on the page you linked:
The rest of your code is A-OK, although I would probably use
plot(t,y_norm)at the end.