shifting a gaussian pulse
6 次查看(过去 30 天)
显示 更早的评论
I wish to shift(delay) a Gaussian pulse in time domain, plot the delayed signal and its Fourier transform over a particular length x(0:16). generally if we have a signal f(t) we shift the signal using f(t-k). For the following Gaussian pulse i tried the same but i get an error. Each contribution is appreciated
clc clear all
Po= 4; % [mW] initial peak power
C = 0; % Chirping Parameter
m = 1; % Super Gaussian parameter
t0 = 100e-12; %initial pulse width
vgroup= 2e8;
alpham=0.24;
attn=0.24;
taum = 10000;
dtau = 2*taum/2^12; %1.953
tunit= 1e-12; % make time unit in psec
tau = (-1000:dtau:(taum-dtau))*tunit;
x=0:16;
bt = sqrt(Po)*exp(-0.5*(1+1i*C)*((tau./t0-(2.*x./vgroup)).^2)).*exp(0.24.*x)% my shifted format
subplot(2,1,1)
plot(tau,bt,'-rx');
l=trapz(x,bt);
subplot(2,1,2);
plot(x,l,'-rx');
I get the following error
??? Error using ==> rdivide Matrix dimensions must agree.
Error in ==> shift at 28 bt = sqrt(Po)*exp(-0.5*(1+1i*C)*((tau./t0-(2.*x./vgroup)).^2)).*exp(0.24.*x)% my shifted format
0 个评论
回答(1 个)
David Young
2011-6-29
tau has 2252 elements but x has 17 elements, so you can't build expressions that try to combine them with elementwise operations. If you give x a scalar value, the computation succeeds (though the call to trapz fails).
Can you explain what you're aiming to do with x?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!