From: Christopher on
Dear all I hope someone might be able to help me.
I have been given some code to analyse the surface roughness of rails and convert it into acoustic noise.

Part of the coding is shown below.

Hs=spectrum.welch('Hann');
Hopts = dspopts.spectrum;
set(Hs,'SegmentLength',seglength);
set(Hs,'OverlapPercent',50);
set(Hs,'FFTLength','NextPow2');
set(Hopts,'Fs',Fs);
hpsd=psd(Hs,rfilt(:,1),Hopts);
f=get(hpsd,'Frequencies');
data=get(hpsd,'data');
alldata(:,1)=data;
% use noct_rp to convert to 1/3 octave bands
[spec_h(:,1),centfreq]=noct_rp(data,f);

When i run this i get the following errors

??? Error using ==> spectrum.abstractspectrum.obsoletefftlength at 14
The 'FFTLength' property is obsolete. Specify your FFT length options
via the psd or msspectrum method.


Error in ==> spectrum.abstractspectrum.setfftlength at 9
obsoletefftlength(this);

Error in ==> RoughProcess_new_version at 246
set(Hs,'FFT','NextPow2');

Can anyone advise

Chris
From: Steven Lord on

"Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message
news:hofvg0$jh1$1(a)fred.mathworks.com...
> Dear all I hope someone might be able to help me.
> I have been given some code to analyse the surface roughness of rails and
> convert it into acoustic noise.
>
> Part of the coding is shown below.
>
> Hs=spectrum.welch('Hann');
> Hopts = dspopts.spectrum;
> set(Hs,'SegmentLength',seglength);
> set(Hs,'OverlapPercent',50);
> set(Hs,'FFTLength','NextPow2');
> set(Hopts,'Fs',Fs);
> hpsd=psd(Hs,rfilt(:,1),Hopts);
> f=get(hpsd,'Frequencies');
> data=get(hpsd,'data');
> alldata(:,1)=data;
> % use noct_rp to convert to 1/3 octave bands
> [spec_h(:,1),centfreq]=noct_rp(data,f);
>
> When i run this i get the following errors
>
> ??? Error using ==> spectrum.abstractspectrum.obsoletefftlength at 14
> The 'FFTLength' property is obsolete. Specify your FFT length options
> via the psd or msspectrum method.
>
>
> Error in ==> spectrum.abstractspectrum.setfftlength at 9
> obsoletefftlength(this);
>
> Error in ==> RoughProcess_new_version at 246
> set(Hs,'FFT','NextPow2');
>
> Can anyone advise

The error message seems pretty clear to me -- rather than trying to set the
FFTLength property (which is now obsolete) you need to modify your call to
the PSD method to specify the FFT length. Look at the HELP for that method
for more information about how to do that.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Christopher on
can anyone help with the programming? No one i know can help me and i the help files not helpping me.


cheers




"Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message <hofvg0$jh1$1(a)fred.mathworks.com>...
> Dear all I hope someone might be able to help me.
> I have been given some code to analyse the surface roughness of rails and convert it into acoustic noise.
>
> Part of the coding is shown below.
>
> Hs=spectrum.welch('Hann');
> Hopts = dspopts.spectrum;
> set(Hs,'SegmentLength',seglength);
> set(Hs,'OverlapPercent',50);
> set(Hs,'FFTLength','NextPow2');
> set(Hopts,'Fs',Fs);
> hpsd=psd(Hs,rfilt(:,1),Hopts);
> f=get(hpsd,'Frequencies');
> data=get(hpsd,'data');
> alldata(:,1)=data;
> % use noct_rp to convert to 1/3 octave bands
> [spec_h(:,1),centfreq]=noct_rp(data,f);
>
> When i run this i get the following errors
>
> ??? Error using ==> spectrum.abstractspectrum.obsoletefftlength at 14
> The 'FFTLength' property is obsolete. Specify your FFT length options
> via the psd or msspectrum method.
>
>
> Error in ==> spectrum.abstractspectrum.setfftlength at 9
> obsoletefftlength(this);
>
> Error in ==> RoughProcess_new_version at 246
> set(Hs,'FFT','NextPow2');
>
> Can anyone advise
>
> Chris
From: Wayne King on
"Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message <hom1i2$ror$1(a)fred.mathworks.com>...
> can anyone help with the programming? No one i know can help me and i the help files not helpping me.
>
>
> cheers
>
>
>
>
> "Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message <hofvg0$jh1$1(a)fred.mathworks.com>...
> > Dear all I hope someone might be able to help me.
> > I have been given some code to analyse the surface roughness of rails and convert it into acoustic noise.
> >
> > Part of the coding is shown below.
> >
> > Hs=spectrum.welch('Hann');
> > Hopts = dspopts.spectrum;
> > set(Hs,'SegmentLength',seglength);
> > set(Hs,'OverlapPercent',50);
> > set(Hs,'FFTLength','NextPow2');
> > set(Hopts,'Fs',Fs);
> > hpsd=psd(Hs,rfilt(:,1),Hopts);
> > f=get(hpsd,'Frequencies');
> > data=get(hpsd,'data');
> > alldata(:,1)=data;
> > % use noct_rp to convert to 1/3 octave bands
> > [spec_h(:,1),centfreq]=noct_rp(data,f);
> >
> > When i run this i get the following errors
> >
> > ??? Error using ==> spectrum.abstractspectrum.obsoletefftlength at 14
> > The 'FFTLength' property is obsolete. Specify your FFT length options
> > via the psd or msspectrum method.
> >
> >
> > Error in ==> spectrum.abstractspectrum.setfftlength at 9
> > obsoletefftlength(this);
> >
> > Error in ==> RoughProcess_new_version at 246
> > set(Hs,'FFT','NextPow2');
> >
> > Can anyone advise
> >
> > Chris

Hi Chris, I think Steve did try to help you. Just looking at your code fragment, try just commenting out

set(Hs,'FFTLength','NextPow2');

The reason is that the FFTLength is specified in

Hopts = dspopts.spectrum;

Look at the value of Hopts.FFTLength. So assuming you have seglength and Fs assigned values somewhere (you didn't show us this above), commenting out

set(Hs,'FFTLength','NextPow2')

should work.

Wayne
From: Christopher on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hom2pe$ffl$1(a)fred.mathworks.com>...
> "Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message <hom1i2$ror$1(a)fred.mathworks.com>...
> > can anyone help with the programming? No one i know can help me and i the help files not helpping me.
> >
> >
> > cheers
> >
> >
> >
> >
> > "Christopher " <guitarhawk(a)hotmail.co.uk> wrote in message <hofvg0$jh1$1(a)fred.mathworks.com>...
> > > Dear all I hope someone might be able to help me.
> > > I have been given some code to analyse the surface roughness of rails and convert it into acoustic noise.
> > >
> > > Part of the coding is shown below.
> > >
> > > Hs=spectrum.welch('Hann');
> > > Hopts = dspopts.spectrum;
> > > set(Hs,'SegmentLength',seglength);
> > > set(Hs,'OverlapPercent',50);
> > > set(Hs,'FFTLength','NextPow2');
> > > set(Hopts,'Fs',Fs);
> > > hpsd=psd(Hs,rfilt(:,1),Hopts);
> > > f=get(hpsd,'Frequencies');
> > > data=get(hpsd,'data');
> > > alldata(:,1)=data;
> > > % use noct_rp to convert to 1/3 octave bands
> > > [spec_h(:,1),centfreq]=noct_rp(data,f);
> > >
> > > When i run this i get the following errors
> > >
> > > ??? Error using ==> spectrum.abstractspectrum.obsoletefftlength at 14
> > > The 'FFTLength' property is obsolete. Specify your FFT length options
> > > via the psd or msspectrum method.
> > >
> > >
> > > Error in ==> spectrum.abstractspectrum.setfftlength at 9
> > > obsoletefftlength(this);
> > >
> > > Error in ==> RoughProcess_new_version at 246
> > > set(Hs,'FFT','NextPow2');
> > >
> > > Can anyone advise
> > >
> > > Chris
>
> Hi Chris, I think Steve did try to help you. Just looking at your code fragment, try just commenting out
>
> set(Hs,'FFTLength','NextPow2');
>
> The reason is that the FFTLength is specified in
>
> Hopts = dspopts.spectrum;
>
> Look at the value of Hopts.FFTLength. So assuming you have seglength and Fs assigned values somewhere (you didn't show us this above), commenting out
>
> set(Hs,'FFTLength','NextPow2')
>
> should work.
>
> Wayne


Thank you to both of you.
Removing the line has now let the program run on 2009,

Once again a big thanks

Chris
 | 
Pages: 1
Prev: reshape
Next: unexpected sendmail error??