shifting a gaussian pulse
조회 수: 9 (최근 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?
참고 항목
카테고리
Help Center 및 File Exchange에서 Switches and Breakers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!