Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Lossless frequency manipulation of an mp3 (Read 6104 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Lossless frequency manipulation of an mp3

Hi,


I´m looking for a method to manipulate an mp3 file in a certain way without reencoding the file. I know tools like mp3gain, musicutter, mp3DirectCut or mp3packer to trim, edit, split/merge, repack, fix, etc... mp3 files losslessly.

Does anyone know if it is possible to manipulate the frequencies of an mp3 (to equalize it) or to apply something like a lowpass filter to it without havig to reencode the file?


Usually the mp3 player or software equalizes the output if needed and it´s not necessarily a good idea to alter an mp3 like this.

In my specific case I have an old recording (mp3, 24 kbps cbr, lame 3.85) of a lecture and I tried to think of way to shift the pitch or to emphasize the lower frequencies (deemphasize the higher ones) in order to make the speaker´s voice sound more pleasant.
I don´t have to do this. I know I could reencode to higher quality using an appropiate dsp setting. But it would be more elegant to achieve this losslessly.  I´m just curious if something like this (selective ReplayGain?) might be technically possible or if anyone could think of another approach or workaround to do anything like this losslessly.

Thank you very much. I´m looking forward to any comments, opinions and ideas :-)

 

Lossless frequency manipulation of an mp3

Reply #1
Does anyone know if it is possible to manipulate the frequencies of an mp3 (to equalize it) or to apply something like a lowpass filter to it without havig to reencode the file?


The short answer to this is: No.

Long answer: There's no tool out there I know of that does this kind of job. You could try to code one that messes with scale factors for equalizing or "simply" set some MDCT samples to zero. The downside however is that "aliasing cancellation" won't work anymore. The problem is that the filterbank is critically sampled. The same is actually true for volume fades that some tools offer (some temporal aliasing will stay).

Cheers,
SG

Lossless frequency manipulation of an mp3

Reply #2
I think the idea of a pre-defined set of equalizer settings to apply at playback, stored in a tag like Replaygain values, is going to be the only way to accomplish this.

Now, do I know of such a program?  Heck no.


Lossless frequency manipulation of an mp3

Reply #4
Thank you all for the answers and thank you Sebastian for the technical insight.
The idea to write EQ information into something like a tag or into a track related configuration file probably would be very player specific - good thought anyway! But preferably it should be a player independent solution.

My kind of problem seems to be rare. I prefer a lossless way to do this, otherwise relatively large numbers of low quality files would have to be reencoded to high quality mp3 to avoid increasing artifacts (as far as possible) and to apply the desired dsp to the new file(s).
I would do that with a small single file and keep the source.


These questions will probably proof my lack of understanding the mp3 format and I am only thinking out loud:

1. Would it be easier (even possible) to manipulate the header informations about the mp3s duration? E.g. 60 seconds of audio data will be declared 70 seconds and a player tries to stretch the available audio data resulting in a overall pitch shift. Okay, even I can guess, that mp3 doesn´t work that way. VBR files can have time informations different from their actual length without causing effects like that - at least in my experience.
But still, would any manipulation of time be possible? Perhaps by adjusting the sample rate? (it´s fixed, I know...)


2. I don´t want to reencode to avoid increasing size and artifacts, but I thought about transcoding it to a lossless format, applying the dsp. My naive approach is my imagination of the lossless file containing the information of the 24 kbps audiodata and a very large amount of data that hasn´t been there before. I imagine that perhaps a conversion to wave only adds data and the added data is different from the original audio information and thus can be identified ... and perhaps deleted seperatly leaving only the old data? Again, I´m pretty sure it doesn´t work that way.

But this idea led me to another: Is there anything like a container format to "repack" the audiodata into without reencoding it?



Again thank you all for your patience. Maybe someone can post one or two links or suggest literature about the technical aspects of mp3 to read for me. :-)

Lossless frequency manipulation of an mp3

Reply #5
Again thank you all for your patience. Maybe someone can post one or two links or suggest literature about the technical aspects of mp3 to read for me. :-)


Beginning reading on MP3:
http://en.wikipedia.org/wiki/Modified_disc...osine_transform
http://www.mp3-tech.org/programmer/docs/trev_283-popp.pdf  [PDF WARNING]
http://en.wikipedia.org/wiki/Mp3#Encoding_audio

Lossless frequency manipulation of an mp3

Reply #6
1. Would it be easier (even possible) to manipulate the header informations about the mp3s duration? E.g. 60 seconds of audio data will be declared 70 seconds and a player tries to stretch the available audio data resulting in a overall pitch shift. Okay, even I can guess, that mp3 doesn´t work that way. VBR files can have time informations different from their actual length without causing effects like that - at least in my experience.
But still, would any manipulation of time be possible? Perhaps by adjusting the sample rate? (it´s fixed, I know...)

Each frame specifies the sample rate for that frame, so in theory it would be possible to change that specification in every frame. However, there are only a few defined sample rates so you are very limited as to how much you can speed up or slow down the playback speed.

I have often wondered what would be the effect of deleting, for example, every fifth frame to speed up playback, or duplicating every fifth frame to slow it down (mindful of the bit reservoir).

Lossless frequency manipulation of an mp3

Reply #7
Kind of on topic, maybe:  just keep in mind that EQing of lossy-encoded material, depending on the psycho-acoustical models used, may sharply expose artifacts that would normally be hidden for most/all listeners in the flat-eq original.

-brendan