Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate fir filters for 24k, low pass and high pass? #1

Closed
azraelkuan opened this issue Jun 17, 2020 · 2 comments
Closed

How to generate fir filters for 24k, low pass and high pass? #1

azraelkuan opened this issue Jun 17, 2020 · 2 comments

Comments

@azraelkuan
Copy link

hi, i am runing a exp with 24khz audio, can u help me?

lp_u = [0.00936455546502, 0.0416254862901, 0.0878313219556,
0.146086321198, 0.192602581136, 0.211221591449,
0.192602581136, 0.146086321198, 0.0878313219556,
0.0416254862901, 0.00936455546502]
#
# high-pass for noise-component in voiced region
# 16kHz, pass-band 7-8K, gain 1, ripple 5dB,
# stop-band 0-5k, gain 0, ripple -40dB)
hp_v = [-0.00936455546502148, 0.04162548629009957,
-0.08783132195564508, 0.1460863211980122,
-0.19260258113649556, 0.21122159144894015,
-0.19260258113649556, 0.1460863211980122,
-0.08783132195564508, 0.04162548629009957,
-0.00936455546502148]
#
# high-pass for noise-component in unvoiced region
# 16kHz, pass-band 3-8K, gain 1, ripple 5dB,
# stop-band 0-1k, gain 0, ripple -40dB)
hp_u = [0.0853841419929, -0.0492022947553, -0.147017860697,
-0.247377645939, 0.710306785317, -0.247377645939,
-0.147017860697, -0.0492022947553, 0.0853841419929]

@TonyWangX
Copy link
Member

TonyWangX commented Jun 17, 2020

Hi,
(Although I haven't tried experiment on hn-nsf for 24kHz waveforms)

You can use the this website to calculate the filter coefficients
http://t-filter.engineerjs.com

  1. Specify sampling freq to 24000 Hz
  2. Change the upper bound of the stop/pass-band to 12000 Hz (rather than 8000)

For example, for lp_v,

16kHz:
pass-band 0-5K, gain 1, ripple 5dB,
stop-band 7-8k, gain 0, ripple -40dB

24kHz:
pass-band 0-5K, gain 1, ripple 5dB,
stop-band 7-12k, gain 0, ripple -40dB

I uploaded one figure for the lp_v 24kHz configuration. The filter coefficients are shown on the right side.

Similarly, you may get the filter coefficients for other FIR filters.

Screen Shot 2020-06-17 at 14 10 25

@azraelkuan
Copy link
Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants