Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Extraction the magnitude responce point
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have this code matlab
>> w = -pi:pi/500:pi;
>> H = freqz(ones(1,10)/10,1,w);
>> subplot(211)
>> plot(w,abs(H))
>> grid; axis([-pi pi 0 1])
>> ylabel('Magnitude Response')
the design,
![001.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261242/001.png)
If xf=-1 : frequency point , xm : magnitude responce point.
How can i extract the magnitude responce point starting from the frequency point ?
2 Kommentare
Meg Noah
am 11 Jan. 2020
I don't have that version or toolbox to get freqz. I think what you want is to interpolate the abs(H) values for the position of xf=01. It would be something like
xm = interp1(w,abs(H),xf,'pchip');
Sorry, I can't help more. Gotta save my allowance to purchase the newer matlab :-(.
Star Strider
am 11 Jan. 2020
Correct!
w = -pi:pi/500:pi;
H = freqz(ones(1,10)/10,1,w);
xm = interp1(w,abs(H),-1);
subplot(211)
plot(w,abs(H))
grid; axis([-pi pi 0 1])
hold on
plot(subplot(2,1,1), [min(w) -1],[1 1]*xm, '-r', [1 1 ]*(-1), [0 xm],'-r')
hold off
text(-1,0,'x_f', 'HorizontalAlignment','center', 'VerticalAlignment','top')
text(min(w),xm,'x_m', 'HorizontalAlignment','right', 'VerticalAlignment','middle')
ylabel('Magnitude Response')
producing:
![1Extraction the magnitude responce point - 2020 01 11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261252/1Extraction%20the%20magnitude%20responce%20point%20-%202020%2001%2011.png)
The ‘xm’ value is about 0.2.
This is your idea, so I’m not posting it as an Answer.
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!