Dont understand this error- unable to resolve filename
2 次查看(过去 30 天)
显示 更早的评论
%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 个评论
回答(1 个)
Walter Roberson
2022-3-28
Either you do not have DSP System Toolbox installed or else you are using 2008 or earlier MATLAB.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!