0

I'm wondering what methods are available to remove a specific frequency from an mp3 or wav file using C#.

I'm hoping for a library or example where I can input an mp3 ( or any other format, ill convert my soundtrack to whatever format is needed) and a single frequency (or list of frequencies) to remove from the file.

If there are no methods of doing this in C# I'll accept solutions using other languages as well.

I prefeer solutions using free or open source libraries.

JensB
  • 6,663
  • 2
  • 55
  • 94
  • What would be the purpose of this? – leppie Jun 18 '12 at 10:47
  • As an anti-piracy measure some albums released this year sample brown noise – Colonel Panic Jun 18 '12 at 11:51
  • look into FFT: http://stackoverflow.com/questions/170394/fast-fourier-transform-in-c-sharp – Isso Jun 18 '12 at 13:59
  • What you need to do is build a filter. Beware though that digital music watermarking isn't this simple. If you are trying to remove a watermark, you are going to very disappointed to find out that it is impossible without knowing the original keys. Most of the watermarking services use spread spectrum, making things very difficult. – Brad Jun 18 '12 at 15:17
  • I would not recommend an FFT. Why? Unless you are dealing with short files, you will have to chunk the data and perform OLA (overlap/Add) on each chunk. Generally, for something like this, time-domain filtering is the solution, but it depends on how specific the frequencies you want to eliminate are. – Bjorn Roche Jun 18 '12 at 19:21
  • This has nothing to do with removing any type of piracy protection. Im trying to remove a constant high pitch noise from many interview recordings. – JensB Jun 19 '12 at 06:25

1 Answers1

1

I would suggest converting your MP3 to PCM, then using a time-domain filter.

A basic approach would be to use the notch filter described here:

http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt

with an implementation like this:

http://musicdsp.org/showArchiveComment.php?ArchiveID=174

Bjorn Roche
  • 11,279
  • 6
  • 36
  • 58