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?
$\begingroup$
$\endgroup$
2
-
$\begingroup$ Any distortions? You can do both FFT based analysis of your signal, or use the envelope mean value. $\endgroup$– jojeck ♦Commented May 29, 2015 at 11:59
-
1$\begingroup$ 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? $\endgroup$– Richard LyonsCommented Aug 28, 2015 at 8:32
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
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.