Why the magnitudes values in magnitude spectrum are different even though the amplitudes of the signals are same
1 view (last 30 days)
Show older comments
Here I have a combined sinusoid(y). It's a combination of two sinusoids one with 7Hz(x1) and one with 40Hz(X2), Amplitudes of both signals are same.
But combined sinusoid's magnitudes values in magnitude spectrum is different.
Why is that?
%code begins
close all;
clear all;
fs = 250;%sampling frequency
N = 1000;%number of data points
W = 2*pi/N;%frequency in rad/s
t = 0:1/250:4;% ;%time index
x1 = sin(2*pi*7*t);%7 hz sinusoid
x2 = sin(2*pi*40*t);%40 hz sinusoid
y = x1+x2;%adding two sinusoids
l = fft(y);
%plotting
figure,plot(abs(l)) ,title('Magnitude Spectrum');
xlabel('Frequency Number'),ylabel('Power');
%code ends
0 Comments
Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!