Filter löschen
Filter löschen

shifting a gaussian pulse

9 Ansichten (letzte 30 Tage)
Neels
Neels am 29 Jun. 2011
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

Antworten (1)

David Young
David Young am 29 Jun. 2011
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 Kommentar
Neels
Neels am 29 Jun. 2011
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

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by