Is there an error in the documentation for SPECTRUM.MTM

Technical Source
1 min readMar 15, 2021

--

Is there an error in the documentation for SPECTRUM.MTM function example in Signal Processing Toolbox 6.2.1 (R14SP1)?

I open the documentation for the SPECTRUM.MTM function in the Signal Processing Toolbox by typing

doc spectrum.mtm

at the MATLAB command window.

I try the following example that is mentioned in the documentation.

Fs=1000;t=0:1/Fs:.3;x=cos(2*pi*t*200)+randn(size(t));[e,v]=dpss(length(x),3.5);Hs=spectrum.mtm(e,v);psd(Hs,x,Fs)

Rather than receiving the plot with the Power Spectral Density, I receive the following error

??? Error using ==> spectrum.abstractspectrum.psd Invalid Parameter/Value pairs.

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:

We have verified that there is an error in the documentation for SPECTRUM.MTM function in the Signal Processing Toolbox 2.6.1 (R14SP1). The following code produces the expected result.

Fs=1000;t=0:1/Fs:.3;x=cos(2*pi*t*200)+randn(size(t));[e,v]=dpss(length(x),3.5);Hs=spectrum.mtm(e,v);psd(Hs,x,'Fs',Fs);        %--->Change from documentation is here.

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet