Re: [alsa-devel] USB device gives wrong data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 23 October 2007 00:05:13 James Cameron wrote:

>
> > How would you filter out noise?
>
> You can filter out DC offset by measuring the offset you have, and
> subtracting this measurement from your samples.

A better way would be to use a highpass filter.

Use something like:


for (i=0; i<=NUM_SAMPLES; i++) {
  hp_last = 0.9999f * hp_last + in[i] - hp_last_in;
  hp_last_in = in[i];
  out[i] = hp_last;
}

You could optimise that a bit.

Gordon
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux