Program to display amplitude of sine signal at each interval and display separately in MATLAB

I am facing a problem on how to separate amplitude of sine signal and compare with other sine signal having same frequency but different amplitude. How can one write a code for this?

• Any distortions? You can do both FFT based analysis of your signal, or use the envelope mean value. – jojek May 29 '15 at 11:59
• Can you give us more information? What does the phrase "separate amplitude" mean? Do you have two different sinusoidal sequences, x[n] and y[n], that you're trying to compare? Or do you have a single x[n] sequence that is the sum of two equal-frequency sinsuoids? – Richard Lyons Aug 28 '15 at 8:32

it's actually easy, you only need to find the maximum value of your sine, which is in turn happens to be your amplitude, then you can compare them with if an if statement.

this gives you the amplitude

max(signal);

use if statement to compare the two values

if max(signal1) == max(signal2)
%% your condition comes here
end

Hope this helps.

cheers.