i am getting an error stating not enough input arguments someone please check through it for my mistakes

2 次查看(过去 30 天)
function[Filterd_Output_Sig,Filt_Nuem,Filt_Denomi] = LPBUTTERFRAC(Msg_bits,Freq_Cutoff,Sam_Frequ,Fil_Order); %error : not enough input arguments
Freq_Nyquist = Sam_Frequ/2;
Non_Dimen_Freq=Freq_Cutoff/Freq_Nyquist;
[Filt_Nuem,Filt_Denomi]=butter(Fil_Order,Non_Dimen_Freq,'low'); % Filter Construction
Filterd_Output_Sig=filtfilt(Filt_Nuem,Filt_Denomi,Msg_bits);
LPF_Par_Order=1;
[Filterd_Output_Sig,Filt_Nuem,Filt_Denomi] =LPBUTTERFRAC(Msg_bits,1000,Freq_Step,5);
[Error_Mag_L,Error_Resp_L] = freqz(Filt_Nuem,Filt_Denomi,256,Freq_Step);
figure(2)
Error_Mag_Frac=angle(Error_Mag_L)*LPF_Par_Order;
plot(Error_Resp_L,Error_Mag_Frac,'r');
LPF_Par_Order=1.2;
[Filterd_Output_Sig,Filt_Nuem,Filt_Denomi]=LPBUTTERFRAC(Msg_bits,1000,Freq_Step,5);
[Error_Mag_L,Error_Resp_L] = freqz(Filt_Nuem,Filt_Denomi,256,Freq_Step);
figure(2)
Error_Mag_Frac=angle(Error_Mag_L)*LPF_Par_Order;
plot(Error_Resp_L,Error_Mag_Frac,'b');
LPF_Par_Order =1.4;
[Filterd_Output_Sig,Filt_Nuem,Filt_Denomi] =LPBUTTERFRAC(Msg_bits,1000,Freq_Step,5);
[Error_Mag_L,Error_Resp_L] = freqz(Filt_Nuem,Filt_Denomi,256,Freq_Step);
figure(2)
Error_Mag_Frac=angle(Error_Mag_L)*LPF_Par_Order;
plot(Error_Resp_L,Error_Mag_Frac,'g');
hold on
LPF_Par_Order =1.6;
[Filterd_Output_Sig,Filt_Nuem,Filt_Denomi]=LPBUTTERFRAC(Msg_bits,1000,Freq_Step,5);
[Error_Mag_L,Error_Resp_L] = freqz(Filt_Nuem,Filt_Denomi,256,Freq_Step);
figure(2)
Error_Mag_Frac=angle(Error_Mag_L)*LPF_Par_Order;
plot(Error_Resp_L,Error_Mag_Frac,'y');
axis on
grid on
legend('order 1','order 1.2','order 1.4','order 1.6');
title('Error Response of Fractional Low Pass Filter')
xlabel('Frequeny');
ylabel('Error Magnitude(dB)');

回答(1 个)

madhan ravi
madhan ravi 2018-12-15
You didn’t define the input arguments before calling the function.

Community Treasure Hunt

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

Start Hunting!

Translated by