filtering DC from digital audio signal

8 views (last 30 days)
Hi people, i need help / advice filtering dc from a 18 bit digital audio signal .
  • the signal i need to filter is an audio signal + dc component in 2´s compliment format, so max=(2^17)-1 and min=-(2^17).
  • i need to filter the dc component and be careful about the output amplitude ranges.
i filtered the dc using highpass(blue_signal,63,Fs) and this happens ( see image ):
  • blue signal: audio signal + dc
  • red signal: audio signal after highpass
  • red line: maximum possible value for 2´s compliment input signal
  • blue line: minimum
Capture.PNG
so , as seen in the picture, the filtered signal exceeds the expected maximum value, so i dont know whats happening, i need to know the output amplitude ranges in order
to reescale the signal between -1 and 1 and do various operations without that dc component, but i dont know how to deal with this.
hope somebody can help me,
thanks anyways :)

Answers (1)

Star Strider
Star Strider on 11 Jan 2019
To filter D-C from any signal, simply subtract the mean value of the signal from the signal. The mean and minus (binary subtraction) functions will work with int8 arguments.
You could also use a highpass filter with a very low frequency (1 Hz or less) cutoff. The highpass filter function in MATLAB only works with single or double precision signals, so simply subtracting the mean would likely be your best option, unless you convert your signals first to do the filtering.
  2 Comments
Min Nepali
Min Nepali on 16 Feb 2022
Edited: Min Nepali on 16 Feb 2022
Would the highpass filter with a very low cut-off frequency ( < 1 Hz) work with sampling rate as high as 1MHz?
Star Strider
Star Strider on 16 Feb 2022
Yes, although the cutoff frequency does not have to be that low.
The filter characteristics (such as cutoff frequency) depend on the sampling frequency of the signal. The filter will need to be designed to give the best results for the signal it is designed to be used with.

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!