Effacer les filtres
Effacer les filtres

Dont understand this error- unable to resolve filename

4 vues (au cours des 30 derniers jours)
Amir Hussain
Amir Hussain le 28 Mar 2022
Commenté : Amir Hussain le 28 Mar 2022
%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.
  2 commentaires
Torsten
Torsten le 28 Mar 2022
Do you have the DSP System Toolbox licenced and installed ?
Amir Hussain
Amir Hussain le 28 Mar 2022
that did the trick.

Connectez-vous pour commenter.

Réponses (1)

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

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by