shifting a gaussian pulse

조회 수: 6 (최근 30일)
Neels
Neels 2011년 6월 29일
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

답변 (1개)

David Young
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?
  댓글 수: 1
Neels
Neels 2011년 6월 29일
Actually i am trying to model the propagation of Gaussian pulse through an optical fiber. if we assume the Gaussian pulse f(t), after traveling a short distance the pulse gets delayed by a factor (2*x/group_velocity). Then finally i integrate the Gaussian pulse over the entire length of the fiber 0 to 16. i have my length as 16 because
l= t*group velocity = 80ns * 2*10^8 =16

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by