Ideas for Audio Compression-related Project?

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: kgudger, bfinio, Moderators

Locked
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Ideas for Audio Compression-related Project?

Post by moonlitknight »

Hi, I would like to conduct a scientific investigation involving audio compression and audio file formats like mp3, wav, etc. I read over the project "MP3 Squeeze" (https://www.sciencebuddies.org/science- ... p025.shtml), but I would like to do something less subjective and more advanced--also, something that uses the Audacity audio manipulator.
hhemken
Former Expert
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm

Re: Ideas for Audio Compression-related Project?

Post by hhemken »

moonlitknight,

What exactly do you want to compare? Sound quality (subjective)? File size (objective)? Something else?

Try something like:

https://www.google.com/#q=comparing+com ... n+audacity

Good luck, and please keep us informed.
Heinz Hemken
Mentor
Science Buddies Expert Forum
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Re: Ideas for Audio Compression-related Project?

Post by moonlitknight »

I was thinking something along the lines of audio quality. A potential question might be, "How does sound quality degrade depending on the type of compression used?" I just don't want the investigation to focus on the psychoacoustic element of what humans consider "high quality" and things like that. I want the investigation to be more about the technical elements of the sound like sample size, compression ratio, bit rate, etc.

Thoughts?
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Re: Ideas for Audio Compression-related Project?

Post by moonlitknight »

Also, how would I frame this project idea into a full scientific investigation with a hypothesis, control, variables...?
hhemken
Former Expert
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm

Re: Ideas for Audio Compression-related Project?

Post by hhemken »

moonlitknight,

If you want to start thinking like a scientist right off the bat, I would suggest you start sketching these things out in writing:

1) what do you think you will find? How can you express it as a refutable hypothesis? For example:
"Different levels of compression affect the entire frequency spectrum equally"

2) A good scientist relies both on intuition and pilot experiments, and based on that decides on the best metric(s) to address the hypothesis. For example, before you go any further with your project, get a high quality uncompressed audio file from somewhere, and create three compressed versions: one only somewhat compressed, one compressed to the average or typical degree found in mp3 files, and one drastically compressed far more than is common. Look at the audio data with some tool like audacity that shows you the waveforms. Look at the video as a whole and try to get a tool that can display different frequency ranges. Try to see by eye what the most striking changes are from compression as compared to the original uncompressed data.

3) Figure out some simple numerical metrics that can represent the changes you saw by eye, and make charts of them where the points on the graph represent the original file and the several compression levels. It might be that the effects are different for different frequency ranges. It may be that you can get interesting differences simply by measuring the average amplitude in each frequency range (plus the standard deviation). Maybe the average frequency in each range says something, possibly because certain frequencies get degraded or exaggerated. Maybe it's the number of peaks above a certain amplitude level.

I have no idea what to expect, but this is how I would start getting a handle on the problem. Once you have these preliminary results, repeat the experiment with more levels of compression so that your charts have more points that trace out smoother curves that show your conclusions in a more convincing and aesthetically pleasing way. People should be able to read your brief conclusions, look at the charts, and say "yeah, I see that." It should take them only a few moments to understand what you did.

It may sound like cheating, but scientists don't coax information from Mother Nature without first poking and prodding her, and gradually exploring what she's doing. I suggest you do the same. If you have access to more sophisticated ways to analyze the frequency ranges, by all means use them.

Good luck, and let us know how things go!
Heinz Hemken
Mentor
Science Buddies Expert Forum
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Re: Ideas for Audio Compression-related Project?

Post by moonlitknight »

Thank you very much for your reply, hhemken, I will make very good use of the advice you provided me. I like your idea about averaging the amplitudes between two different compressions to find a meaningful difference and I have already another interesting approach using the mathematical differences between two files.

But, I need (1) some more ideas for independent variables and (2) additional empirical methods of gathering data for this project. Specifically, I need help with evaluating the fidelity of the compressed file to the WAV file (my controlled variable). I already have the method mentioned above--taking the mathematical difference between the two files.

Here's the question I've decided to research, by the way:

Question: Which audio compression factor has the most impact on the sound quality of music files?
hhemken
Former Expert
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm

Re: Ideas for Audio Compression-related Project?

Post by hhemken »

moonlitknight,

I think your project question tells you what your independent variable is, the compression factor you use most likely determines the sound quality of the music. If you need more independent variables, then you can use one or two of the other settings you can tweak when storing a compressed audio file. That of course depends on the software you use.

I suspect bitrate/compression is your main independent variable, and maybe even your only one. The interesting part of your project is how you measure things related to audio quality in an objective, quantitative way. Your dependent variables will be the metrics you can get out of the files themselves, i.e. the mathematical differences, frewquency range differences, or whatever you can figure out. We can't do that for you, that's the whole point of the project!

Please keep us posted. I'm assuming you can write programs in some language like Perl, Java, Python, PHP, Visual basic, or whatever. Can you?

Good luck!
Heinz Hemken
Mentor
Science Buddies Expert Forum
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Re: Ideas for Audio Compression-related Project?

Post by moonlitknight »

I started to learn Python a few months ago for another project idea, but I abandoned it to focus on this new topic of audio compression. Why would knowing a programming language be helpful for this particular project?

In other news, I have encountered a problem with my testing. So far, I've tried out the mathematical difference test on one of my favorite Genesis songs. I ripped the song from the CD as a WAV and as a 320 Kbps MP3 and imported them both into Audacity. I aligned the tracks (MP3s have gaps in the beginning and end) and used the "invert" effect on the MP3 track. I exported the two tracks (inverted MP3 + WAV) so that when they got merged together, the inverse MP3 track would cancel out with the frequencies it shared with the WAV track. What I was left with was the "difference," or what the MP3 was missing compared to the WAV. There didn't appear to be much data compared to the MP3, but it was definitely noticeable on playback and on the waveform graph. My next thought was to look at the file sizes of the "difference" track, which I expected to be very small, and the original WAV file, which I expected to be very large. But, for some reason, the difference track has a file size of 25,225,324 bytes and the original, unmodified WAV has 25,225,444 bytes. A difference of only 120 bytes does not seem reasonable based on the results I've gathered. Am I assuming something incorrectly about how file sizes work or am I doing something wrong in Audacity?
hhemken
Former Expert
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm

Re: Ideas for Audio Compression-related Project?

Post by hhemken »

moonlitknight,

I have to say that I'm not an audacity expert nor even of audio files in general. Have you looked at the audacity forums (http://forum.audacityteam.org/)? I suggest you search them for information and post your questions there. I'm certain there are some extremely knowledgeable people there who can give you guidance on how to compare audio quality.

My programming question intended to see if you might be inclined to do a lot of your analyses from command line scripts. See for example:

http://wiki.hydrogenaudio.org/index.php ... udio_Tools
https://wiki.python.org/moin/Audio/

That should give you more than enough resources to resolve your current stumbling blocks. Please let us know if you still have problems, and also let us know what new and cool things you manage to discover.

Good luck!
Heinz Hemken
Mentor
Science Buddies Expert Forum
moonlitknight
Posts: 6
Joined: Mon Jan 13, 2014 12:05 pm
Occupation: Student: 12th grade
Project Question: I am hoping to conduct an investigation involving audio compression in music.
Project Due Date: 4/1/2014
Project Status: I am conducting my research

Re: Ideas for Audio Compression-related Project?

Post by moonlitknight »

I joined the Audacity forum and posted my questions and received an answer very quickly. Apparently, there are many things going on in Audacity that would prevent me from collecting any meaningful or useful data, unfortunately. And the software and theory of it all is way beyond my knowledge for me to try to tackle it.

Thank you very much for your commitment and help, hhemken.
hhemken
Former Expert
Posts: 266
Joined: Mon Oct 03, 2005 3:16 pm

Re: Ideas for Audio Compression-related Project?

Post by hhemken »

moonlitknight,

What about the python libraries? Usually doing it directly in a scripting language like python strips away complexity and allows you to be more focused on individual tasks. Have you had a look? In practice, most people would probably go with that instead of hoping that an application like audacity allows you to do exactly what you want.

It may be a bit more laborious and you'll have to learn a few tricks, but I suspect it will be more powerful and the things you learn will be useful to you even after this project is finished.

Let us know, and good luck!
Heinz Hemken
Mentor
Science Buddies Expert Forum
Locked

Return to “Grades 9-12: Math and Computer Science”