How do I get frequency response as values from multibandParametricEQ System object?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hiroshi Iwamura
le 22 Août 2018
Modifié(e) : michio
le 28 Oct 2019
I cant visualize the response using visualize(mPEQ). But I want "values" as [h,w]. How do I get?
0 commentaires
Réponse acceptée
Kei Otsuka
le 24 Août 2018
To extract frequency response, modifying or adding your own function to multibandParametricEQ.m might be helpful.
For example, you can use computefreqz, one of the dsp.util.FilterVisualizer object function to calculate frequency response within a multibandParametricEQ.
?
#1. Add following to visualize function defined in multibandParametricEQ.m
fVector = logspace(log10(20),log10(Fs/2),NFFT);
H = obj.visualObj.computefreqz(coeffs, fVector', Fs);
data = 20*log10(abs(H));
#2. Add output arguments to visualize function
function [data, fVector] = visualize(obj,NFFT)
#3. Confirm if modified method works
mPEQ = multibandParametricEQ(...
'NumEQBands',1,...
'Frequencies',9.5e3,...
'PeakGains',10);
[h, w] = visualize(mPEQ)
figure, semilogx(w,h)
ax = gca;
ax.YLim = [-25 25];
ax.XLim = [20 44100/2];
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)')
grid on
grid minor
2 commentaires
Kei Otsuka
le 25 Août 2018
That's great, thanks for sharing your experience with us.

The error you run into was because dsp.util.FilterVisualizer is not available on R2016a. This is just FYI, but you can use freqz instead like this;
fVector = logspace(log10(20),log10(Fs/2),NFFT);
H = freqz(coeffs{1}, [1;coeffs{2}], fVector', Fs);
data = 20*log10(abs(H));
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur フィルター解析 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!