DSPRelated.com
Forums

how to generate a signal with prescribed psd

Started by npast October 17, 2008
Hello

I am trying this method but I have 2 questions:
-the spectrum of the real part of the noise generated by the algorithme
follows the initial spectral density but is very noisy 
-there is a deacreasing in amplitude of the signal to zero where the two
vectors (initial and conjugte) meets, if for instance, I use the psd :
[1:2500] on 2500 samples.

Is it the same for you ?


>"npast" <npastouchenko@gmail.com> wrote in message >news:QeadnWtmn_HfTmXVnZ2dnUVZ_jednZ2d@giganews.com... >> hi, >> >> Is there a way to generate a random signal which has a prescribed
power
>> spectral density, psd? >> >> I have analytic formula for the broadband power spectral density, and
I
>> need to generate a random time signal that is supposed to model
acoustic
>> pressure, p(t), as a function of time, having given psd. Phase is not >> important, so I think it should be possible to generate a signal
somehow?
> >Well, as a humble (aerospace) engineer, I usually just read and try to
learn
>from this ng, as my maths and dsp knowledge is at the beginner-end of the
scale,
>but as no-one else has said so: you could simply create the full complex
>spectrum whilst randomising the phase: for an N-pt spectrum, of amplitude
am at
>freq f, set the amplitude of the +ve frequency bin [i] as follows: >real[i] = am*cos(phase[i])/2 >imag[i] = am*sin(phase[i])/2 > >and put the other half in the -ve frequency bins (j=N-i) to create the
complex
>conjugate part: >real[j] = real[i] >imag[j] = -imag[i] > >where phase[] is an array of random values between -pi and +pi. > >Then perform an inverse FT on the real-imag arrays (watching out for 1/N
>factors) to give a time signal. > >There may be howls of protest at this - and I am willing to learn - but i
use
>this to create exactly the sort of signal you want. If it isn't right,
then i
>am doing something else wrong when I analyse the results! > >HTH, Martin > >