How to write code for a composite signal with instantaneous frequency
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jan Ali
el 20 de Nov. de 2020
Comentada: Jan Ali
el 10 de En. de 2021
Anyone can help me with writing code for this function?
0 comentarios
Respuesta aceptada
Swetha Polemoni
el 23 de Nov. de 2020
Hi Jan Ali,
It is my understanding that you want to add three signals that are defined only in particular intervels of time. Following code might help you.
t = (-1:0.01:1); % defining time axis
unitstep1=t>=0; % unitsetp1 takes 1 only when t is greater than equal to 0
unitstep2=t>=0.1; % unitsetp2 takes 1 only when t is greater than equal to 0.1
unitstep3=t>=0.18;% unitsetp3 takes 1 only when t is greater than equal to 0.18
unitstep4=t>=0.3; % unitsetp4 takes 1 only when t is greater than equal to 0.3
rect1=unitstep1-unitstep2; % rect1 takes 1 only when 0<=t<0.1
rect2=unitstep2-unitstep3; % rect2 takes 1 only when 0.1<=t<0.18
rect3=unitstep3-unitstep4; % rect2 takes 1 only when 0.18<=t<0.3
% taking three random sine siganls
Signal1=sin(2*pi*50*t);
Signal2=sin(2*pi*150*t);
Signal3=sin(2*pi*500*t);
% Composite signal
Sc= Signal1*rect1+Signal2*rect2+Signal3*rect3;
8 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Elementary Math en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!