How to use sinc function
Mostra commenti meno recenti
I am getting an error that reads, "Check for missing argument or incorrect argument data type in call to function 'sinc' ". I am trying to implement this piecewise function, for designing FIR filter using the Fourier series method. This is what I am doing:
omegac = 0.3*pi; % Cutoff frequency
L = 50; % Filter order L = 61
M = (L-1)/2; % M
l = 0:2*M; % Coefficient index l
h = omegac/pi*sinc(omegac*(l-M)/pi); % Compute coefficients
omega = -pi:2*pi/200:pi; % Frequency range
Hd = freqz(h,1,omega); % Frequency response
plot((omega/pi),abs(Hd)),... % Use normalized frequency
xlabel('Normalized frequency'), ylabel('Magnitude'), grid;
axis([-1 1 0 1.2]);
2 Commenti
Walter Roberson
il 4 Giu 2020
Is the problem only showing up when you use MATLAB Coder, or is it happening in basic MATLAB as well?
Your posted code works for me.
Could you confirm that you have Signal Processing Toolbox installed and licensed?
ROBERT Gomez
il 22 Nov 2022
Thanks a lot for this sir.
Risposta accettata
Più risposte (1)
Ayush Goyal
il 18 Giu 2020
0 voti
From my understanding of the question you are trying to use the sinc function but getting error while calling it. To use the sinc function you must have licensed and installed the Signal Processing Toolbox. To check all the installed toolboxes in MATLAB you can use command “ver”. In case you don’t find the Signal Processing Toolbox installed you can refer to the following link to install the toolbox:
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!