Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MbedJSONValue mbed
Fork of TAU_ReSpeaker_DSP_Test by
Matlab_Script/HighPassFilterDesign.txt
- Committer:
- Arkadi
- Date:
- 2018-02-11
- Revision:
- 1:574b54755983
File content as of revision 1:574b54755983:
function [Hd, SOS, G] = HighPassFilterDesign(FilterFs,Fc, FilterOrder, RipplePass, RippleStop, FilterType) % On the base of https://www.youtube.com/watch?v=crRNF8JjzIs % %Filter design % Biquad Direct Form 1 Wn = (2/FilterFs)*Fc; % design a second order filter: if strcmp(FilterType,'butter') [z,p,k] = butter(FilterOrder,Wn,'high'); [SOS,G] = zp2sos(z,p,k); Hd = dfilt.df1sos(SOS,G); else if strcmp(FilterType,'cheby2') [z,p,k] = cheby2(FilterOrder,RippleStop, Wn, 'high'); [SOS,G] = zp2sos(z,p,k); Hd = dfilt.df1sos(SOS,G); else if strcmp(FilterType,'ellip') [z,p,k]=ellip(FilterOrder,RipplePass,RippleStop,Wn,'high'); [SOS,G] = zp2sos(z,p,k); Hd = dfilt.df1sos(SOS,G); else error('WRONG PARAMETER!!! Stop execution!'); quit end end end end