Considering having the theoretical signal given below as an instance.

clear all; close all; clc;

sampling_freq=1000;%Sampling frequency

f1=12;f2=30;f3=22;f4=18;%frequencies at various interval of time

t1=0:1/sampling_freq:1;%time vector for the first frequency component

t2=1:1/sampling_freq:1.5;%time vector for the second frequency component

t3=1.5:1/sampling_freq:2;%time vector for the third frequency component

t4=2:1/sampling_freq:4;%time vector for the fourth frequency component

time=[t1,t2,t3,t4];

y1=sin(2*pi*f1*t1);%defining the first frequency component

y2=sin(2*pi*f2*t2+45*pi/180);%defining the second frequency component

y3=cos(2*pi*f3*t3+30*pi/180);%third frequency component

y4=sin(2*pi*f4*t4-75*pi/180);%fourth frequency component

signal=[y1,y2,y3,y4];%Non-Stationary signal

figure;plot(time,signal);

Similar questions and discussions