Dont understand this error- unable to resolve filename

1 view (last 30 days)
%Set the Sampling frequency and Sample Period
Fs=10000;
Ts=1/Fs;
%Generate the waveforms that we are looking for. NB this can be
%performed more elegantly using a loop.
t=0:Ts:10;
wave =sin(2*pi*100*t) +sin(2*pi*200*t) +sin(2*pi*300*t)
+sin(2*pi*400*t)+sin(2*pi*500*t)+sin(2*pi*600*t);
%You can use the commands
figure; plot(t,wave);
axis([0 0.1000 -5 5]);
xlabel("Time");
ylabel("Amplitude");
DataLength = length(wave);
NFFT = 2^nextpow2(DataLength); % Next power of 2 from length of wave
Amplitude = abs(fft(wave,NFFT)) / (DataLength / 2);
% The amplitude is scaled by Datalength/2 to reflect the fact that %the FFT is
double sided
RMSPower = Amplitude(1:NFFT/2)/sqrt(2);
% The amplitude measurement returned by the FFT is the peak
% amplitude. Since we are more used to working in Power, convert
% this by a factor of 1/sqrt(2) knowing that we are dealing with
% sinusoids.
PowerdB = 20*log10(RMSPower);
% Generate the frequency binds that are required for plotting the FFT
step=(Fs/NFFT);
f=0:step:Fs/2-step;
%Plot single-sided amplitude spectrum.
figure(2); plot(f,PowerdB);
D=fdesign.lowpass('N,Fc',50,500,Fs);
designmethods(D);
Hd = design(D);
%The output of the filter design can be viewed using the filter view tool
fvtool(Hd);
ERROR is
D=fdesign.lowpass('N,Fc',50,500,Fs); line
and it says
Unable to resolve the name fdesign.lowpass.

Answers (1)

Walter Roberson
Walter Roberson on 28 Mar 2022
Either you do not have DSP System Toolbox installed or else you are using 2008 or earlier MATLAB.

Categories

Find more on Signal Processing Toolbox in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!