vvm32812
vvm32812

Reputation: 25

Reducing one frequency in song

How would I take a song input and output the same song without certain frequencies?

Based on my research so far, the song should be broken down into chucks, FFT it, reduce the target frequencies, iFFT it, and stitch the chunks back together. However, I am unsure if this is the right approach to take, and if so, how I would convert from the audio to FFT input (what seems to be a vector matrix), how to reduce the target frequencies, and how to convert back from the FFT output to audio, and how to restitch.

For background, my grandpa loves music. However, recently he cannot listen to it, as he has become hypersensitive to certain frequencies within songs. I'm a high school student who has some background coding, and am just getting into algorithmic work and thus have very little experience using these algorithms. Please excuse me if these are basic questions; any pointers would be helpful.

EDIT: So far, I've understood the basic premise of fft (through basic 3blue1brown yt videos and the like) and that it is available through scipy/numpi, and figured out how to convert from youtube to 0.25 second chunks in a wav format.

Upvotes: 2

Views: 147

Answers (1)

MBo
MBo

Reputation: 80232

Your approach is right.

Concerning subquestions:
from the audio to FFT input - assign audio samples to real part of complex signal, imaginary part is zero

how to reduce the target frequencies - multiply FFT results near needed frequency by smooth (to diminish artifacts) function that becomes zero at that freqency and reaches 1.0 some samples apart

how to convert back - just make inverse FFT (don't forget about scale multiplier like 1/N) and copy real part into audio channel


Also consider using of simpler digital filtering - band-stop or notch filter.

Arbitrary found example1 example2
(calculation of parameters perhaps requires some understanding of DSP)

Upvotes: 2

Related Questions