0

I'm trying to reconstruct an audio signal, and below is what i got after rescaling.

enter image description here

How can i obtain centered audio signal such as below?

enter image description here


SOLVED:

ruoho ruotsi's answer addresses my problem :)

i found someone asked the similar question before

How to remove or filter the drift problem in measured Strain signal?

anony
  • 15
  • 1
  • 6
  • Welcome to SE.DSP. You are reconstructing and rescaling a signal using unmentioned processing. They could influence the trend, background or baseline you are observing. Could you please be more specific about your reconstruction? – Laurent Duval Dec 30 '15 at 18:01
  • I was about to say... ;-( – Peter K. Dec 31 '15 at 00:56

3 Answers3

1

"Center" isn't the word that I'd use to describe what you want to do. Your signal does not have a zero-mean, so like @Dole suggested you should use a DC-Blocker (DC-Offset removing) filter to get the job done:

Here are your references:

https://ccrma.stanford.edu/~jos/filters/DC_Blocker.html https://ccrma.stanford.edu/~jos/filters/DC_Blocker_Frequency_Response.html https://ccrma.stanford.edu/~jos/filters/DC_Blocker_Software_Implementations.html

the code (from the above links) can be as simple as this, where x is the current sample and y is the filtered sample, while xm1 and ym1 are the x,y from the previous step (i.e. x[i-1], y[i-1]):

  y = x - xm1 + 0.995 * ym1;
  xm1 = x;
  ym1 = y;
ruoho ruotsi
  • 1,770
  • 9
  • 10
1

Use small High Pass filter. Usually it is suggested to remove the frequencies in the range of 0-200 Hz for speech signals.

Arpit Jain
  • 687
  • 1
  • 5
  • 13
0

Remove DC offset. Either convert to frequency domain and remove bin 0 or just use a very low frequency high pass filter.

Dole
  • 348
  • 1
  • 17