clear all
%close all

Fs = 2048;
t= 0:1/Fs:1-1/Fs;

x1 = 0.5*sin(2*pi*t*2);
x2 = 0.3*sin(2*pi*t*20);

x3 = x1 + x2;
x4 = [x1(1:1024) x2(1025:2048)];

subplot(4,1,1);
plot(t,x3);
xlim([0,1]);
xlabel('time in s'); 
ylabel('Amplitude');
title('Signal x3');

subplot(4,1,2);
[S,F,T,P] = spectrogram(x3,1024,0,1024,Fs);
surf(T,F,10*log10(P),'edgecolor','none'); axis tight; 
view(0,90);
xlabel('time in s'); 
ylabel('Frequency in Hz');
title('WFT Spectrogram of x3');
ylim([0,50]);

subplot(4,1,3);
plot(t,x4);
xlim([0,1]);
xlabel('time in s'); 
ylabel('Amplitude');
title('Signal x4');

subplot(4,1,4);
[S,F,T,P] = spectrogram(x4,1024,0,1024,Fs);
surf(T,F,10*log10(P),'edgecolor','none'); axis tight; 
view(0,90);
xlabel('time in s'); 
ylabel('Frequency in Hz');
title('WFT Spectrogram of x4');
ylim([0,50]);
