The MASM Forum

General => The Soap Box => Topic started by: Siekmanski on October 08, 2014, 06:47:35 AM

Title: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 08, 2014, 06:47:35 AM
There is a free online DSP course at Coursera (Stanford University).
The title is Audio Signal Processing for Music Applications.

Here you can sign in for free: http://coursera.org/course/audio
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 08, 2014, 08:19:57 AM
And not to forget, Marinus:

Quote
Yes you will earn an Statement of Accomplishment if you do well in the course.
:t

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 08, 2014, 10:02:14 AM
Hi Gunther,

They are using the Python programming language for the assignments, not my cup of tea.
I'll just follow the course without doing the programming assignments, so no Statement or Certificate for me.
But, hope to learn a lot for my own use.

At this moment i'm rewriting my old Fast Fourier Transform routines, so this course might be handy.  :biggrin:
Title: Re: Audio Signal Processing for Music Applications
Post by: jj2007 on October 08, 2014, 10:25:05 AM
They are using the Python programming language for the assignments, not my cup of tea.

Marinus,
You made me curious, so I found this page comparing Python to Basic (http://rox.sourceforge.net/desktop/book/export/html/44.html). I guess one could get used to it, but it's not my cup of tea, either (hey, aren't you coffee drinkers in NL??).
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 08, 2014, 10:28:50 AM
Yes, we are "koffie drinkers" in the Netherlands.  :lol:
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 08, 2014, 12:51:45 PM
i'm going to be away for a few weeks, but let's see if i can keep up - lol
python - probably not, but i may give it a whirl
i wonder what they'd think if i turned in ASM code   :P
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 08, 2014, 07:48:56 PM
Quote
i wonder what they'd think if i turned in ASM code   :P
Let's do that.  8)
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 08, 2014, 07:54:18 PM
Quote
i wonder what they'd think if i turned in ASM code   :P
Let's do that.  8)

Okay, go forward fellows.  :icon_cool:

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Zen on October 10, 2014, 08:34:14 AM
Hi,...Siekmanski (Marinus),
This is a fascinating topic (I'm not being a wiseass for once).
Years ago, while I was playing around with some song writing software that I had (Cakewalk Sonar),...I had the brilliant idea of writing a music file format analyzer based on DSP concepts.
I somehow acquired a book about Digital Signal Processing from a used bookstore, and, began my quest. The mathematics is mind-boggling. I almost made it through Chapter One (Introduction), and, couldn't understand it at all (and, it was written for C programmers).
Quote from: SIEKMANSKI
At this moment i'm rewriting my old Fast Fourier Transform routines,...
Do you REALLY understand the: Fourier Transform (http://en.wikipedia.org/wiki/Fourier_transform) ???

...I'll bet GUNTHER has a clear grasp of the subject,...
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 10, 2014, 08:47:38 AM
i guess he does - see reply #2   ;)

which is easier to implement in hardware or software than it is to understand the math - lol
Title: Re: Audio Signal Processing for Music Applications
Post by: Zen on October 10, 2014, 08:50:32 AM
How does a person express an irrational number in assembly language ???
Let me make a guess: by pretending it doesn't exist,...
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 10, 2014, 08:52:52 AM
perhaps as a complex number
but - you factor out the "i" part - same way they manage them in algebraic equations

(http://picomonster.com/wordpress/wp-content/images/complex_definition.gif)

i = -11/2

usually, the lower-case Greek letter Iota is used
oddly enough, i don't find a good picture of how you see it in math books   :redface:
Title: Re: Audio Signal Processing for Music Applications
Post by: Zen on October 10, 2014, 08:56:22 AM
In all honesty,...I think that (Marinus) Siekmanski should get some kind of MASM Forum award for posting the source code to his programs.
This really is a uniquely valuable contribution. I have to admire his intelligence.

...But, maybe,...it's just that I'm an intellectual reprobate,...
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 10, 2014, 09:03:20 AM
you saw all the math on the wiki page, right   :shock:

here's a simplifed block diagram that might be used for hardware or software
so - it's not nearly as bad as you might think   :biggrin:

(http://cnx.org/resources/ae7723ceeb6ba1926cd962517d2e40f8/image4.png)
Title: Re: Audio Signal Processing for Music Applications
Post by: Zen on October 10, 2014, 09:10:30 AM
DAVE !!!
I have an excellent sense of humor,...but,...

(http://ceasefiremagazine.co.uk/wp-content/uploads/headinsand.jpg)
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 10, 2014, 11:08:15 AM
Hi Zen,

I have just completed 2 FFT routines.
One for SSE2 and one for SSE3.
I tried to make them as fast as i can.
These routines calculate 2 samples at once.
Also tried 4 samples at once but i need to study this approach first.
I'll comment the code and then post the sources if you like.

Maybe i'll write a FFT analyzer. ( just like the FIR analyzer )

Marinus
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 11, 2014, 04:59:55 AM
Here are the sources for the SSE2 and SSE3 FFT routines.

There are still some things todo to speed up the routines;
The bit-reversal routine could be faster if you use addresses instead of pointers....
We could save log2 times "shufps" instructions but the Sine Cosine tables would be twice as long...
And speed things up by prefetching data/code into caches.

Marinus

Title: Re: Audio Signal Processing for Music Applications
Post by: Zen on October 11, 2014, 07:04:53 AM
Hi, MARINUS,   
Thanks for the examples,...I gave it a quick read,...and, not surprisingly,...I had NO IDEA what the code was doing,...Ha,...ha,...
...But, I'll do some reading on the subject,...and try to understand the FFT routines.   

I'm still playing around with your FIR Spectrum Analyzer code. Years ago, I wrote a number of simple graphics apps (with DirectX 9), and audio stuff using DirectShow filters, in C++, using Visual Studio (which is much more convenient for COM). DirectX 11 isn't even similar  to me, so, I'm reading as much of the documentation as I can. I'm sure the functionality is the same, but, all the structures and interfaces are all newly configured.
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 11, 2014, 08:06:37 AM
many thanks Marinus - that will save a lot of people a lot of work   :t   :t
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 11, 2014, 08:11:16 AM
Thanks Dave,
I'm totally in the mood since following the ASP course  :lol: :lol:
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 11, 2014, 08:12:13 AM
i haven't got started on that, yet
kinda busy, so i may not have a chance
Title: Re: Audio Signal Processing for Music Applications
Post by: K_F on October 12, 2014, 03:14:44 AM
I tried searching for my FFT (FPU) example i posted but cannot find it...
I'm not near my usual PC, maybe someone can find it or upload it again ?
 :t
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 12, 2014, 05:01:09 AM
http://www.masmforum.com/board/index.php?topic=15955.msg136123#msg136123 (http://www.masmforum.com/board/index.php?topic=15955.msg136123#msg136123)
Title: Re: Audio Signal Processing for Music Applications
Post by: guga on October 12, 2014, 05:28:52 AM
I started the course yesterday. I´ll try to follow it. It seems amazing.
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 12, 2014, 10:36:18 PM
Hi Marinus,

thank you for uploading the sources. Solid work.  :t

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 12, 2014, 10:51:15 PM
Thank you Gunther.
Title: Re: Audio Signal Processing for Music Applications
Post by: K_F on October 13, 2014, 07:50:21 AM
http://www.masmforum.com/board/index.php?topic=15955.msg136123#msg136123 (http://www.masmforum.com/board/index.php?topic=15955.msg136123#msg136123)
Thank you, Sire !
I must be getting old timers - just couldn't find it

 :biggrin:
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 15, 2014, 11:00:27 AM
I have implemented the FFT routines i posted here before, in this proggy.
You can see the FFT routine in action now...

FFT size is 1024 and the vertical scale is 90 dB.

EDIT: Today i followed the new class about window functions (ASP course) and discovered an error in my blackman and blackman-harris window calculations.
Corrected these errors and uploaded a new exe.

You can test the window functions by playing this frequency sweep file. http://members.home.nl/siekmanski/20Hz-20KHz.wav
Notice the differences between main lobes and side lobes of the window functions.
To look at the frequency sweep turn off FFT Smoothing.

Marinus

(http://members.home.nl/siekmanski/ffttest.png)

New exe,
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 15, 2014, 04:15:27 PM
very cool, Marinus   :t
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 15, 2014, 11:16:51 PM
Excellent work, Marinus.  :t Thank you for sharing it.

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 15, 2014, 11:56:50 PM
Thanks guys,

The ASP course is great and everything is well explained.
I had several moments of ooooh's and ahaaa's during the classes.

Dave, today the class starts explaining STFT and spectrograms.
Title: Re: Audio Signal Processing for Music Applications
Post by: RuiLoureiro on October 16, 2014, 02:27:49 AM
Hi,
Interesting work, Siekmansky !  :t
note: I tried to test, but i have not any WAV file 16 bit Stereo 44100Hz.
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 16, 2014, 03:14:40 AM
the WAV files in Marinus' FIR example will work

http://masm32.com/board/index.php?topic=3568.msg37702#msg37702 (http://masm32.com/board/index.php?topic=3568.msg37702#msg37702)
Title: Re: Audio Signal Processing for Music Applications
Post by: RuiLoureiro on October 16, 2014, 05:32:39 AM
the WAV files in Marinus' FIR example will work

http://masm32.com/board/index.php?topic=3568.msg37702#msg37702 (http://masm32.com/board/index.php?topic=3568.msg37702#msg37702)

Hi Dave,
FIRtest5 hasn't any one WAV !
Title: Re: Audio Signal Processing for Music Applications
Post by: dedndave on October 16, 2014, 05:42:12 AM
FIRanalyzer2 and 3 do
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 16, 2014, 06:52:40 AM
Hi RuiLoureiro,

You can find free wav files here

http://www.freesound.org/search/?q=44100+stereo+16
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 16, 2014, 08:18:45 AM
Today i followed the new class about window functions (ASP course) and discovered an error in my blackman and blackman-harris window calculations.
Corrected these errors and uploaded a new exe. (see Reply #27 )

You can download a frequency sweep file (see Reply #27 ) and test the window functions.
Notice the differences between main lobes and side lobes of the window functions.
To look at the frequency sweep turn off FFT Smoothing.

Marinus
Title: Re: Audio Signal Processing for Music Applications
Post by: RuiLoureiro on October 16, 2014, 10:05:39 PM
Hi Marinus,
Thanks  :t
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 16, 2014, 11:52:30 PM
Thank you, Marinus. You work very seriously.

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 17, 2014, 02:00:21 AM
Yes, i'll try to understand as much as possible as explained in the ASP course and do the "assignments" in asm.
Next step is plotting the Phase and Unwrapped-Phase.
Title: Re: Audio Signal Processing for Music Applications
Post by: caballero on October 17, 2014, 08:59:04 PM
Do you know if after the end of the course would be possible to download the course? It's a bit difficult for to me to follow it, but seems to be very interesting :t

Regards
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 17, 2014, 10:15:01 PM
I don't know, send them an email and ask them ?
Title: Re: Audio Signal Processing for Music Applications
Post by: K_F on October 17, 2014, 10:18:52 PM
Do you know if after the end of the course would be possible to download the course? It's a bit difficult for to me to follow it, but seems to be very interesting :t
Here's a good (free) starters book  ...http://www.dspguide.com/ (http://www.dspguide.com/)

Easy to follow.
Title: Re: Audio Signal Processing for Music Applications
Post by: caballero on October 17, 2014, 10:36:33 PM
It has a nice look, thank you K_F  :biggrin:
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 17, 2014, 10:53:48 PM
This is really a great book. Learned a lot from it and the explanations are very well done.
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 18, 2014, 10:48:30 PM
Marinus,

This is really a great book. Learned a lot from it and the explanations are very well done.

so it seems that it's worth the effort.  :t

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 19, 2014, 02:02:38 AM
Hi Gunther,
yes, it's not that difficult to read, and the explanations are very good also for beginners.
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 19, 2014, 06:08:10 PM
Another free DSP book: https://archive.org/download/SignalProcessingFirst/SignalProcessingFirst-McclellanSchaferYoder.pdf
Title: Re: Audio Signal Processing for Music Applications
Post by: Gunther on October 19, 2014, 10:28:29 PM
Another free DSP book: https://archive.org/download/SignalProcessingFirst/SignalProcessingFirst-McclellanSchaferYoder.pdf

 :t

Gunther
Title: Re: Audio Signal Processing for Music Applications
Post by: guga on October 22, 2014, 04:21:33 AM
Ok, now i saw your fft analyser. Excllent work.

Will you release the source ? I would like to take a look at it how you managed to make the spectrum works.

Question. Can you make the spectrum be zoomed ? I mean, like we see in IzotopeRX or Audacity where the whole audio data is displayed and not just in runtime.
Title: Re: Audio Signal Processing for Music Applications
Post by: Siekmanski on October 22, 2014, 08:40:26 AM
Hi guga,

The routines for the FFT you can download here: see Reply #16
The analyzer is nothing more than a 1024 sample FFT normalized.

The magnitude spectrum is calculated as follows :
 do the FFT routine.
 Get the sqrt((Real*Real)+(Imag*Imag)) for every 512 positive complex sample. ( this is the first half of the FFT output)
 Then draw the result as lines to the screen.

To zoom the spectrum as i think you mean is choose an offset in your audiodata and do the FFT with the amount of samples you like 1024, 2048, 4096 etc.... and draw them to the screen.
Or get for example 200 audio samples and fill the rest with zeros to 2048 samples total and then do a FFT of 2048.
Now you have the frequency response of 200 samples zoomed out over 1024 output bins.