I am using the following code to generate four sine waves using a sampling rate of 8000.
Fs = 8000; % samples per second
Ts = 1/Fs; % seconds per sample
t = 0: Ts: 3; % Start signals at 0sec and stop after 3sec
% Sine wave x1[n]:
Fc = 320;
x1 = sin(2*pi*Fc*t);
% Sine wave x2[n]:
Fc = 760;
x2 = sin(2*pi*Fc*t);
% Sine wave x3[n]:
Fc = 1280;
x3 = sin(2*pi*Fc*t);
% Sine wave x4[n]:
Fc = 2000;
x4 = sin(2*pi*Fc*t);
x_comp = x1 + x2 + x3 + x4;
Now I need to plot the frequency magnitude spectrum of the composite signal (x_comp) in dB. How can I achieve this please?
I used the code below but the plot is not making sense.
x_comp = x1 + x2 + x3 + x4;
x_comp_mag = abs(fft(x_comp));