Reply by mimizan April 18, 20062006-04-18
Forget everything : i was looking at angle(E1t) and not imag(E1t). The imag
noise is flat and less than 10^-14.
However, I still have a noise amplification problem in my code but this is
another story (see http://www.dsprelated.com/showmessage/54930/1.php).

Thanks.

P.S : It's hard not to post nonsense when you need help.
Reply by mimizan April 18, 20062006-04-18
Ok,

I'm sorry I forgot to mention that ws was set to zero here. Actually the
noise I was talking a
Reply by Andor April 18, 20062006-04-18
mimizan wrote:

> function f=gaussienne(t,tau,ws) > % The gaussian function > f=exp(-(t/tau).^2).*exp(-i*ws*t);
I think you need to review the definition of the Gaussian function ... Hint: it's real valued. Regards, Andor
Reply by Rune Allnor April 18, 20062006-04-18
mimizan skrev:
> >Hi, > > a true Gaussian function has infinite width, so > >you had to truncate that function by some amount. > > > >Can you post your MATLAB code here? > > Hi, > > thanks for answering. What is strange is that the less I truncate, the > worse it is. I suspect this is a newbie problem. Here are extracts from my > code : > > m=40000; % Number of points
<split-hair-mode> Well, no, it's half the number of points. </split-hair-mode>
> tstep=0.002e-9; > time=(-m:1:m-1)*tstep; % Time array; tstep is the sampling step > > function f=gaussienne(t,tau,ws) > % The gaussian function > f=exp(-(t/tau).^2).*exp(-i*ws*t);
This one puzzled me. What is 'ws'? Why don't you use 'tau' with the imaginary part?
> tau=6e-9; % 6 ns pulse > E0t=gaussienne(time,tau,0); % Input gaussian array > > E1t=ifft(fft(E0t)); % To test the ifft > > myplot2(time,E0t,time,E1t); % Custom function to compare both arrays > > N.B : Changing the sampling interval doesn't help.
Rune
Reply by mimizan April 18, 20062006-04-18
>Hi, > a true Gaussian function has infinite width, so >you had to truncate that function by some amount. > >Can you post your MATLAB code here?
Hi, thanks for answering. What is strange is that the less I truncate, the worse it is. I suspect this is a newbie problem. Here are extracts from my code : m=40000; % Number of points tstep=0.002e-9; time=(-m:1:m-1)*tstep; % Time array; tstep is the sampling step function f=gaussienne(t,tau,ws) % The gaussian function f=exp(-(t/tau).^2).*exp(-i*ws*t); tau=6e-9; % 6 ns pulse E0t=gaussienne(time,tau,0); % Input gaussian array E1t=ifft(fft(E0t)); % To test the ifft myplot2(time,E0t,time,E1t); % Custom function to compare both arrays N.B : Changing the sampling interval doesn't help.
Reply by Rick Lyons April 11, 20062006-04-11
On Tue, 11 Apr 2006 07:26:34 -0500, "mimizan" <spambox@neuf.fr> wrote:

>>ok this is really dumb...i will reply to myself! >>rounding errors contribute to this, should take real(ifft(s)) or >>abs(ifft(s)), i think there is not much difference since imaginary >>parts are really small. >> >>jeremy > >Hi all, > >This, I understand. It is not a problem as long as the imaginary parts >stay small. But what if they become larger ? Here's my problem : > >- Take a gaussian function of width tau, and sample if from, let's say, >-5*tau to 5*tau. ifft(fft) only generates a very small imaginary part >(<10^-10) > >- Take the same function but sample it from -15*tau to 15*tau. This time >ifft(fft) generates very large (>1) imaginary parts in the edges of the >gaussian ! > >I thought that it was because the gaussian was too small at the edges so >that numerical errors became too important in the ifft. So I forced the >function to go to exact zero by multiplying by a square function, because >I know that an exact zero will become an exact zero through ifft(fft). I >didn't help, or even, worsen things. > >What should I do ? > >Thank you.
Hi, a true Gaussian function has infinite width, so you had to truncate that function by some amount. Can you post your MATLAB code here? [-Rick-]
Reply by mimizan April 11, 20062006-04-11
>ok this is really dumb...i will reply to myself! >rounding errors contribute to this, should take real(ifft(s)) or >abs(ifft(s)), i think there is not much difference since imaginary >parts are really small. > >jeremy
Hi all, This, I understand. It is not a problem as long as the imaginary parts stay small. But what if they become larger ? Here's my problem : - Take a gaussian function of width tau, and sample if from, let's say, -5*tau to 5*tau. ifft(fft) only generates a very small imaginary part (<10^-10) - Take the same function but sample it from -15*tau to 15*tau. This time ifft(fft) generates very large (>1) imaginary parts in the edges of the gaussian ! I thought that it was because the gaussian was too small at the edges so that numerical errors became too important in the ifft. So I forced the function to go to exact zero by multiplying by a square function, because I know that an exact zero will become an exact zero through ifft(fft). I didn't help, or even, worsen things. What should I do ? Thank you.
Reply by Jerry Avins March 16, 20062006-03-16
Jerry Avins wrote:
> jeremyscerri@gmail.com wrote: > >> comp.dsp should include this in the acronyms list... > > > We can do without cutsie for cutsie's sake ...
Sometimes I get huffier than I should. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins March 16, 20062006-03-16
jeremyscerri@gmail.com wrote:
> comp.dsp should include this in the acronyms list...
We can do without cutsie for cutsie's sake, thank you. Even "tnx" is off the mark, but it's better, and as short. Much slang supports an "us vs. them" outlook; knowing the meaning shows that one is part of the "in" group. Everybody is welcome in comp.dsp, even those who struggle with English. There is no need to demonstrate one's "membership". Remember: this is a quasi-professional international forum, not a chat room where quick turnaround can outweigh clarity and precision of expression. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by jere...@gmail.com March 16, 20062006-03-16
comp.dsp should include this in the acronyms list...

jeremy