Reply by Stan Pawlukiewicz November 8, 20052005-11-08
khmaies wrote:
> Dear All, > I am strugling writing a matlab code to present the PSD of a random > sequence of data. > I am not getting a smooth curve like I see it in some textbooks. Could > anyone help me with Matlab code where I can get the PSD graph which look > like a continues curve. > Thans a lot > Regards > khmaies
First of all if you have a nice strong pure tone, It's going to stick out like a spike and spikes are not particularly smooth.
Reply by Stan Pawlukiewicz November 8, 20052005-11-08
Real_McCoy wrote:
> "Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message > news:dknrs6$429$1@newslocal.mitre.org... > >>Real_McCoy wrote: >> >>>"Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message >>>news:dkiffa$ic7$1@newslocal.mitre.org... >>> >>> >>>>Lars Hansen wrote: >>>> >>>> >>>>>>Fourier transform of a random process is another random process :) >>>>>> >>>>>>what you need to do is perform the above several dozen times (at > > least) > >>>>>>and then average the resulting FFTs - only then will you see the >>>>>>smoothness start to appear. >>>>> >>>>> >>>>> >>>>>Yes, but LPC-analysis will give you a smooth approximation of the >>>>>non-parametric power spectrum... >>>>> >>>>> >>>>> >>>> >>>>Are you saying that you don't need to average? >>>> >>>>There are lots of ways to smooth but they aren't necessarily accurate. >>>> >>> >>>Not if you use parametric methods. LPC is not so good at measuring zeros >>>since it is an all-pole method. There are pole-zero techniques which > > require > >>>more computation. >>> >>>McC >>> >>> >> >>If I understand you, you are saying that parmetric methods do not >>require averaging.i.e the Cramer Roa bounds do not depend on the number >> of samples or the number of snap shots. >> >>I've never used an LPC method that didn't benefit from averaging the >>covariance estimates. If I recall correctly, the context of this post >>was for stationary processes. >> > > Yes I agree - that would help but for many of the original applications you > could not average. The whole point was that there was a limited data set ie > the Woolfson Sunspot Numbers for instance was probably one of the first > applications of the solution of the Yule-Walker equations. (the paper was by > Yule of course).Iyou have lots of data then you don't really need > parametric methods in the first place. > > > McC > >
Kind of depends on the parameter and the application. Don't really know what the size of the original poster's problem is, unless of course I missed it. Fitting an all pole model to an all zero process might be smooth but it really isn't going to be particularly accurate.
Reply by November 8, 20052005-11-08
Lars Hansen <jojo@yahpoo.com> wrote:
>> Fourier transform of a random process is another random process :) >> >> what you need to do is perform the above several dozen times (at least) >> and then average the resulting FFTs - only then will you see the >> smoothness start to appear. > > > Yes, but LPC-analysis will give you a smooth approximation of the > non-parametric power spectrum...
Smooth not always mean a sensible approximation. Run your code in a loop for an example Ns=256 times, you get the 3*sigma confidence about 20% for the parametric peak. In another post you wrote:
> but you can just increase the order of the LPC-analysis to model the zeros
Ok, you can alway do so, but the Wold's theorem says that conversions between finite AR i MA models gives an infinite representation :) Try your code with a not _perfidious_ transfer function: change the numerator from [1] to [1 0.5] - a model of order 6 isn't too bad, but again - looping for Ns=256 you get about 40% for CL :( Don't mix two areas of modelling/approximation: - a temporal representation (example: audio processing) - a statistical inference about stochastic processes
Reply by Real_McCoy November 7, 20052005-11-07
"Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message
news:dknrs6$429$1@newslocal.mitre.org...
> Real_McCoy wrote: > > "Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message > > news:dkiffa$ic7$1@newslocal.mitre.org... > > > >>Lars Hansen wrote: > >> > >>>>Fourier transform of a random process is another random process :) > >>>> > >>>>what you need to do is perform the above several dozen times (at
least)
> >>>>and then average the resulting FFTs - only then will you see the > >>>>smoothness start to appear. > >>> > >>> > >>> > >>>Yes, but LPC-analysis will give you a smooth approximation of the > >>>non-parametric power spectrum... > >>> > >>> > >>> > >> > >>Are you saying that you don't need to average? > >> > >>There are lots of ways to smooth but they aren't necessarily accurate. > >> > > > > Not if you use parametric methods. LPC is not so good at measuring zeros > > since it is an all-pole method. There are pole-zero techniques which
require
> > more computation. > > > > McC > > > > > > If I understand you, you are saying that parmetric methods do not > require averaging.i.e the Cramer Roa bounds do not depend on the number > of samples or the number of snap shots. > > I've never used an LPC method that didn't benefit from averaging the > covariance estimates. If I recall correctly, the context of this post > was for stationary processes. >
Yes I agree - that would help but for many of the original applications you could not average. The whole point was that there was a limited data set ie the Woolfson Sunspot Numbers for instance was probably one of the first applications of the solution of the Yule-Walker equations. (the paper was by Yule of course).If you have lots of data then you don't really need parametric methods in the first place. McC
Reply by Stan Pawlukiewicz November 7, 20052005-11-07
Real_McCoy wrote:
> "Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message > news:dkiffa$ic7$1@newslocal.mitre.org... > >>Lars Hansen wrote: >> >>>>Fourier transform of a random process is another random process :) >>>> >>>>what you need to do is perform the above several dozen times (at least) >>>>and then average the resulting FFTs - only then will you see the >>>>smoothness start to appear. >>> >>> >>> >>>Yes, but LPC-analysis will give you a smooth approximation of the >>>non-parametric power spectrum... >>> >>> >>> >> >>Are you saying that you don't need to average? >> >>There are lots of ways to smooth but they aren't necessarily accurate. >> > > Not if you use parametric methods. LPC is not so good at measuring zeros > since it is an all-pole method. There are pole-zero techniques which require > more computation. > > McC > >
If I understand you, you are saying that parmetric methods do not require averaging.i.e the Cramer Roa bounds do not depend on the number of samples or the number of snap shots. I've never used an LPC method that didn't benefit from averaging the covariance estimates. If I recall correctly, the context of this post was for stationary processes.
Reply by Phil November 5, 20052005-11-05
khmaies wrote:
> I am strugling writing a matlab code to present the PSD of a random > sequence of data. > I am not getting a smooth curve like I see it in some textbooks. Could > anyone help me with Matlab code where I can get the PSD graph which look > like a continues curve.
Try Rainbow ... http://digitalCalculus.com/page/593045 ... it has some 10+ algorithms for a PSD and these vary like crazy in their results. Finding key peak (i.e. frequencies) is hard in itself. Good luck hunting. Phil
Reply by Lars Hansen November 5, 20052005-11-05
>> > Not if you use parametric methods. LPC is not so good at measuring zeros > since it is an all-pole method. There are pole-zero techniques which > require > more computation. > > McC >
That's true, but you can just increase the order of the LPC-analysis to model the zeros... - but you are right...pole-zero techniques are probably more efficient
Reply by Real_McCoy November 5, 20052005-11-05
"Stan Pawlukiewicz" <spam@spam.mitre.org> wrote in message
news:dkiffa$ic7$1@newslocal.mitre.org...
> Lars Hansen wrote: > >>Fourier transform of a random process is another random process :) > >> > >>what you need to do is perform the above several dozen times (at least) > >>and then average the resulting FFTs - only then will you see the > >>smoothness start to appear. > > > > > > > > Yes, but LPC-analysis will give you a smooth approximation of the > > non-parametric power spectrum... > > > > > > > Are you saying that you don't need to average? > > There are lots of ways to smooth but they aren't necessarily accurate. >
Not if you use parametric methods. LPC is not so good at measuring zeros since it is an all-pole method. There are pole-zero techniques which require more computation. McC
Reply by Stan Pawlukiewicz November 5, 20052005-11-05
Lars Hansen wrote:
>>Fourier transform of a random process is another random process :) >> >>what you need to do is perform the above several dozen times (at least) >>and then average the resulting FFTs - only then will you see the >>smoothness start to appear. > > > > Yes, but LPC-analysis will give you a smooth approximation of the > non-parametric power spectrum... > > >
Are you saying that you don't need to average? There are lots of ways to smooth but they aren't necessarily accurate.
Reply by Lars Hansen November 5, 20052005-11-05
> Fourier transform of a random process is another random process :) > > what you need to do is perform the above several dozen times (at least) > and then average the resulting FFTs - only then will you see the > smoothness start to appear.
Yes, but LPC-analysis will give you a smooth approximation of the non-parametric power spectrum...