Plotting a rectangular pulse with a exponential under the rectangular pulse
Afficher commentaires plus anciens
Hello,
I am trying to create a MATLAB Simulation that uses this equation:
s(t) = A*rect(t/tau)*exp(j*w*t); where w = 2*pi*f and f = 3 GHz
Then I am looking to I am looking to create another MATLAB Simulation using this equation:
s(t)= [rect((t-to)/tau)+ rect((t+to)/tau)]*exp(j*w*t)
but if possible I need the second equation to have the same amount of energy as the first equation.
Therefore, the second equation will be skinnier, but have a higher amplitude to compensate for the energy lost.
Any help would be greatly appreciated.
Thank you!
Réponses (1)
Image Analyst
le 11 Fév 2017
How about starting like this:
f = 3 % GHz
w = 2*pi*f
tau = 9; % Whatever...
t = 1 : 500; % Whatever...
A = 40; % Whatever...
s1 = A*rect(t/tau)*exp(j*w*t);
plot(t, s1, 'b-');
grid on;
s2 = [rect((t-to)/tau)+ rect((t+to)/tau)]*exp(j*w*t)
s1Area = sum(.....
s2Area = sum(.....
s1 = s1 / s1Area;
s2 = s2 / s2Area;
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!