Can someone here has a sample of high pass filter

2019-04-03 00:27发布

Good day. I am poor of DSP. I have difficulties understanding the algorithm. I have a c# application, a recorder function that will record a sound waves but this sound is a mixture of all sounds. specifically, when i receive the data i will filter this data to save only the filtered audio data with high frequency, example cutoff frequency is 15khz. For this filter, given are the samples of data with size, and the cutoff frequency

C/C++ is fine

At the time i received that samples of data, apply highpass filter then save the result to the wav.

-thong

1条回答
姐就是有狂的资本
2楼-- · 2019-04-03 00:50

You need to know the sample rate and also have a reasonable idea of your filter specification before you can design a suitable filter. Just specifying a 15 kHz cut-off is not really enough, e.g. you might want something like this:

Sample rate: 44.1 kHz
Stop-band: < 12 kHz
Stop-band rejection: > 80 dB
Pass-band: > 15 kHz
Passband ripple: +/- 1 dB

You can then feed these parameters into a filter design package and this will give you all the filter coefficients etc.

Note that the complexity of the filter (i.e. filter order = number of stages or "taps") will be highly dependent on the filter specification, so ideally you want to use a filter design package which lets you play around with the spec easily so that you can trade off your design requirements against the required compute bandwidth.

You will also need to decide whether phase and/or group delay are important to you - use a linear phase FIR for a constant group delay (more expensive) or a recursive IIR if phase/delay are not critical (much cheaper to implement).

Note that there are free online filter design packages available, e.g. http://www-users.cs.york.ac.uk/~fisher/mkfilter/ looks pretty good (it can even generate a C code filter implementation for you), although it may require at least beginner-level signal-processing knowledge when it comes to selecting filter types etc.


To help understand basic filter design parameters, here is a useful diagram from http://dspguru.com. Note that this is for a low pass filter, but the same parameters apply in the high pass case.

enter image description here

查看更多
登录 后发表回答