Fourier Analysis And Audio Synthsizing, An important assingnment 
Fourier Analysis And Audio Synthsizing, An important assingnment 
Dec 6 2009, 09:04 PM
Post
#1


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
I am currently writing a project on the topic "Fourier analysis and audio synthsizing"
Does anyone have knowledge on this topic, and care to explain it? or perhaps link to usefull articles The project is pretty important for me, so it would be very nice if you could share your knowledge, especially if there are some mathematical or physical brainiacs in here. practical knowledge on synthesizing is also very welcome Frederik 


Dec 7 2009, 03:52 AM
Post
#2


Instructor Group: GMC Instructor Posts: 5.655 Joined: 11October 09 From: Bogota Member No.: 7.694 
that's quite interesting, I just watched this video
Good luck with that This post has been edited by Daniel Realpe: Dec 7 2009, 03:54 AM  Visit my:
INSTRUCTOR PROFILE "If a composer could say what he had to say in words he would not bother trying to say it in music." Gustav Mahler Subscribe to my Youtube Channel here 


Dec 7 2009, 11:54 AM
Post
#3


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
That was pretty usefull, im probaly gonna watch i a couple more times to really get how he figured out the fourier coeficients
any other knowledge on synthesizing is still more than welcome! 


Dec 7 2009, 12:05 PM
Post
#4


Instructor Group: GMC Instructor Posts: 7.201 Joined: 14July 08 From: London UK Member No.: 5.490 
I had that module at school but nothing like this guy on the video We just had to produce synthetic sounds by using software for it. No equations
 Check out my <a href="https://www.guitarmasterclass.net/instructor/EmirHot" target="_blank">Instructor profile</a>
www.emirhot.com www.myspace.com/emirhotguitar www.myspace.com/sevdahmetal 


Dec 7 2009, 01:16 PM
Post
#5


Learning Tone Seeker Group: Members Posts: 1.114 Joined: 26January 08 From: Melbourne, Australia Member No.: 3.995 
Please don't call me a nerd but I did study it 78 years back, even gave a paper on it .. but I'm SO glad i remember nothing of it !!
You should be able to find a lot of articles on it online.. Apologies im not much help now .. maybe a few years back I wouldve been All the best on the project !!  "If the need is deep, you WILL find a way , if it isn't, you'll find some excuse"
Check out my Student Instructor Lesson on Metal Riffing HERE Visit My Youtube Channel 


Dec 7 2009, 01:19 PM
Post
#6


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
Please don't call me a nerd but I did study it 78 years back, even gave a paper on it .. but I'm SO glad i remember nothing of it !! You should be able to find a lot of articles on it online.. Apologies im not much help now .. maybe a few years back I wouldve been All the best on the project !! Thanks sorry not to be ab´le to call u a nerd, cause that just what i need 


Dec 7 2009, 01:24 PM
Post
#7


Learning Tone Seeker Group: Members Posts: 1.114 Joined: 26January 08 From: Melbourne, Australia Member No.: 3.995 
Shhhh .. u shouldnt say that or you wont get any replies
And somehow the word fourier sent chills down my spine .. so I'm thinking i must've come very close to failing the test ,  "If the need is deep, you WILL find a way , if it isn't, you'll find some excuse"
Check out my Student Instructor Lesson on Metal Riffing HERE Visit My Youtube Channel 


Dec 7 2009, 01:57 PM
Post
#8


Competitions Coordinator  Up the Irons Group: GMC Senior Posts: 5.462 Joined: 17February 08 From: Stavanger, Norway Member No.: 4.276 
I "borrowed" this from URS on the KVR forums:
The fourier transform converts a time representation ( samples ) into a frequency representation ( i.e. the frequency spectrum of these samples ) and vice versa. Commonly it splits a number of audio samples, say 2048, into a corresponding number of sine waves of different frequencies, so that you know the volumes and the phase for each sine. The principle is very simple: If you multiply a set of samples with another set of reference samples and add each result, like this: result = sample[ 0 ] * reference[ 0 ] + sample[ 1 ] * reference[ 1 ] + ... + sample[ n ] * reference[ n ] ... the result is an indicator for the similarity of both sets of samples. And now with sines Now, if you want to know the volume and the phase of a sine at a certain frequency inside an audio sample, you have to calculate 2 of these similarity values: FC = 2 * PI * frequency / samplerate; // "frequency constant" result_i = sample[ 0 ] * sin( FC * 0.f ) + sample[ 1 ] * sin( FC * 1.f )+ ... + sample[ n ] * sin( FC * n.f ) result_r = sample[ 0 ] * cos( FC * 0.f ) + sample[ 1 ] * cos( FC * 1.f )+ ... + sample[ n ] * cos( FC * n.f ) To get the actual phase and magnitude, you use simple pythagoras to get length and trigonometry to get the angle: magnitude = sqrt( result_i * result_i + result_r * result_r); phase = atan2( result_i, result_r) // I think... This way you can determine how much of a frequency is present in an audio file etc., and which phase it has relative to the beginning. Complex Numbers? In Fourier Transform lingo, the sine part is oftenly called "imaginary" while the cosine part is called "rational". They pretend to be complex numbers, but that's more or less only a convention. The phase/magnitude representation IMHO feels more like complex numbers. Getting the whole spectrum Now, the idea behind fourier transforms is, if you start with a "fundamental" frequency of exactly 1 cycle over the whole length of the analysed set of samples (call it n samples) and do this with every multiple up to n/2 of the fundamental, you get a representation that thoroughly reflects the spectrum of the original sample.  If you transform it back (create a new bunch of n samples out of adding sines and cosines), it will perfectly fit the original samples! Each "frequency slot" or multiple of the fundamental (1, 2, 3, ..., n/2) is called a "bin". (Note, there's also a zerobin, I'll explain that later) Fast Fourier Transform  FFT This would be a very time consuming technique, if there wasn't the Fast Fourier Transform, or FFT. The FFT is a simple, yet highly difficult to understand algorithm. It takes advantage of the fact, that if you draw all those sines in a graph, you have many lines that cross each other at certain points. And because they cross each other pretty often, you need only 1 multiply to gather information for many results needed. Hence, what FFT does is recursively reordering ("prepacking", "butterfly") the samples in a tricky way so that only a fraction of calculations are needed to create the spectrum for a given range of audio samples. The drawback is, FFT requires certain lengths (or "ns") of samples, which are a power of 2: like 16, 32, 1024, 4096 samples etc. DC offset and Nyquist in FFTs Typically, a FFT outputs the spectrum in sines and cosines, but it also output 2 special values: A cosine representing the DC (offset of powers above zero and below zero), which is bin 0, or the fundamental frequency * 0 and a sine representing Nyquist (because at Nyquist, there can't be a cosine!). Hence some algorithms require N/2+1 bins, others "pack" the Nyquist bin into the sine field of the DC bin. This is a fairly "easy" decription according to him.... Hope this might be of help 


Dec 7 2009, 02:09 PM
Post
#9


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
Yeah, its a hard nut to crack
great post audiopaal 


Dec 7 2009, 03:29 PM
Post
#10


GMC:er Group: Members Posts: 221 Joined: 13August 09 From: Finland Member No.: 7.514 
This is a really interesting topic . Thanks for the videos Daniel, I've already watched five and so far they are really easy to understand. I'm math logic major, so I don't almost anything about Fourier analysis (sorry Frederik ), but I'm already beginning to understand how it all works.
By the way what exactly do you need : creating different waveforms by combining sinusoids or decomposing waveforms into sinusoids? (as far as I unerstood the latter is more difficult, and it is what Paal was writing about ). 


Dec 7 2009, 03:33 PM
Post
#11


Moderation Policy Director Group: GMC Instructor Posts: 10.459 Joined: 6February 07 From: CT, USA Member No.: 1.167 
There are many approaches to synthesis but here are a few simple ideas and building blocks.
So called "Subtractive Synthesis" in the old analog syas consisted of generating a waveform then filtering it in various ways. Nowaday in the digital domain, you can still do the same thing in a few steps. Firstly, you need to generate a waveform. This is a simple mathematical function such as sin(). When you are working as a VST plugin, all you have to do is give the host a sequence of numbers that represent the amplitude of the waveform you want to create, once for each sample. So, a little math allows you to work out how the voltage evolves over time. For instance: 440hz is a particular pitch of the note A. You know that the sinewave needs to cycle every 1/440th of a second, and that your sample rate is for example 44,000 khz. 44,000/440 = 1000, so we want to split our wave into 1000 steps. Each complete wave consists of 360 degrees, so we divide 360 by 1000 to get .36. Now all we need to do is start at zero, and add .36 for each sample, and take the sine of that to get the amplitude  that gives you a basic sound. Of course you would want to read the keyboard and check which note is being asked for and then do the appropriate math as above but with a different frequency for each note  that is the basis of getting a sound out. You may need to do this for several notes at once if you are writing a polyphonic synth, and you would then need to mix the resulting signals together. That is simply a case of multiplying each by a scaling factor (to represent the overall loudness) and adding them. Next, you may want to filter, and that is where the fourier analysis comes in. Fourier analysis basically looks at a section of samples, for instance a second, or a millisecond, and performs a calculation that represents that data exactly, but broken down into frequency bands. When you write the algorithm you decide how many bands. If for instance you had 20 bands you would end up with a value for each band over that time period. Now we can play with frequency  pick a band and multiply it by a scaling factor and you have increased or decreased the amplitude of just that frequency. If you then subject it to a reverse fourier, you will end up with the original sound with an altered frequency balance  this is the basics of how digital EQs and graphic equalizers work. So now our simple synth has generated a sinewave and filtered it  Subtractive synthesis. The rest is just more complex math!  Check out my Instructor profile
Live long and prosper ... My Stuff: Electric Guitars : Ibanez Jem7v, Line6 Variax 700, Fender Plus Strat with 57/62 Pickups, Line6 Variax 705 Bass Acoustic Guitars : Taylor 816ce, Martin D15, Line6 Variax Acoustic 300 Nylon Effects : Line6 Helix, Keeley Modded Boss DS1, Keeley Modded Boss BD2, Keeley 4 knob compressor, Keeley OxBlood Amps : Epiphone Valve Jnr & Head, Cockburn A.C.1, Cockburn A.C.2, Blackstar Club 50 Head & 4x12 Cab 


Dec 7 2009, 04:36 PM
Post
#12


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
By the way what exactly do you need : creating different waveforms by combining sinusoids or decomposing waveforms into sinusoids? (as far as I unerstood the latter is more difficult, and it is what Paal was writing about ). I currently cannot understand how he finds the fouriercoefficients so what where im behind is "decomposing waveforms into sinusoids" if you mind to explain what u understood i would be very appretiated what i have to do is not prove it (even though i would like to) but do a short theoretical statement(I hope it means sort of "explanation") of fourier analysis (splitting a complex periodic signal  tone, into sinewaves/signals) Thanks Andrew Nice input especially with the EQ. thats a really nice practical example to use. gives me the idea to talk about noisegating (which is eliminating to frequensies below a certain amplitude (a set value for the fourier coefficints) and filtering (removing a certain bandwith(frequency spectrum) of the signal?) 


Dec 7 2009, 05:55 PM
Post
#13


GMC:er Group: Members Posts: 221 Joined: 13August 09 From: Finland Member No.: 7.514 
I'll explain how he finds coefficients, just give me a couple of minutes
By the way, QUOTE Rest your fingers and brain between practice sessions, in order to practice effectively and avoid injury. This is certainly not about this topic 


Dec 7 2009, 06:05 PM
Post
#14


Moderation Policy Director Group: GMC Instructor Posts: 10.459 Joined: 6February 07 From: CT, USA Member No.: 1.167 
Thanks Andrew Nice input especially with the EQ. thats a really nice practical example to use. gives me the idea to talk about noisegating (which is eliminating to frequensies below a certain amplitude (a set value for the fourier coefficints) and filtering (removing a certain bandwith(frequency spectrum) of the signal?) Noise gating would simply be based on the amplitude of the original signal  no fourier transforms needed for that. Although some noisegates listen to specific frequency ranges for the signal, and yes, you would use a fourier transform to figure that out  Check out my Instructor profile
Live long and prosper ... My Stuff: Electric Guitars : Ibanez Jem7v, Line6 Variax 700, Fender Plus Strat with 57/62 Pickups, Line6 Variax 705 Bass Acoustic Guitars : Taylor 816ce, Martin D15, Line6 Variax Acoustic 300 Nylon Effects : Line6 Helix, Keeley Modded Boss DS1, Keeley Modded Boss BD2, Keeley 4 knob compressor, Keeley OxBlood Amps : Epiphone Valve Jnr & Head, Cockburn A.C.1, Cockburn A.C.2, Blackstar Club 50 Head & 4x12 Cab 


Dec 7 2009, 07:02 PM
Post
#15


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
I'll explain how he finds coefficients, just give me a couple of minutes By the way, This is certainly not about this topic Nice! and tell me about it i actually had a headache 5 mins ago Noise gating would simply be based on the amplitude of the original signal  no fourier transforms needed for that. Although some noisegates listen to specific frequency ranges for the signal, and yes, you would use a fourier transform to figure that out Ahh i see but wouldnt you have to seperate the noise from the signal? elseway the signal too will be cut a bit? 


Dec 7 2009, 07:15 PM
Post
#16


GMC:er Group: Members Posts: 221 Joined: 13August 09 From: Finland Member No.: 7.514 
OK, first I hope you believe the formulas he has on the right side of the board . Then we take some function f:[pi,pi]>R which is integrable on this interval. The next thing is  we assume that this function is expandable to the trigonometric series
The problem now is to find all coefficients. Our first try is integrating both sides (f is integrable and the right hand side is a sum of integrable functions, although I'm not completely sure if it works for infinite sums). Now he makes assumption that we can interchange the summation and integral signs  again, for finite sums there is no question, but maybe there are special infinite cases... whatever . Then we simplify the expression: The last step uses these formulas that he has on the right : So, from here it is easy to derive a_0: Now, going to a_n, n>0... First you multiply both sides of the Fourier expansion by cos(kx), where k is (any) positive integer and then integrate both sides: Now we exchange sum and integral as above to get The leftmost integral of the right hand side is zero by the formula above. Now take a close look at what's inside the sum. The right integral is always zero  by one on the formulas on the board. The left integral also seems to be always zero, but if n=k (and since it all happens under summation sign, n takes all possible positive integer values, and k is positive integer > n will be equal to k at some point), then the expression will simplify to cosine squared of kx, and for this case there is another formula, which states that the integral of this is pi . So, inside the sum, everything is zero except one integral at n=k, so this whole thing simplifies to: or You can get b_n by the same process, but multiplying by sine kx instead of cosine kx. Hope that helps . If something is unclear, just ask 


Dec 7 2009, 07:55 PM
Post
#17


GMC:er Group: Members Posts: 221 Joined: 13August 09 From: Finland Member No.: 7.514 
Also about wave decomposition (note : those are my own thoughts and as such are very unreliable ):
I'd guess, if you want to use this method with Fourier series directly, first step would be to approximate the input wave with some kind of function : it may be a step function, or something like this: The point is, you divide the interval into a finite number of subintervals, and on each subinterval approximate the initial wave with some simple function. In the end, you will get piecewise continious function, which will be integrable and usable for finding coefficients However, this is kind of bruteforce way and as such will require LOADS of computations (imagine computing integral for every small function you get ). There is most certainly a much better way. Anyway, just thoughts 


Dec 7 2009, 08:23 PM
Post
#18


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
Thank you so much
i have i few dummy/lingo questions first: What "amount of numbers" is Z+ ? dunno the english tranlation and what is an interger? So the first expression is just math for what we have assumed? am i right? i had been wondering how they got that expression for long those funktions on the right of his board (those that equals zero, and pi) should they be obvious (if thats the case, then ill look at them and understand them) or are they to advanced? they seem simple, but i might be wrong. that the same area i below the graph as the one over the graph can you explain how you can interchange(meaning switch?) the sigma (at least for finite amounts)? i can see som sort of realtion. that integrals sums up. and sigma writes a lot of sums .. Also about wave decomposition (note : those are my own thoughts and as such are very unreliable ): I'd guess, if you want to use this method with Fourier series directly, first step would be to approximate the input wave with some kind of function : it may be a step function, or something like this: The point is, you divide the interval into a finite number of subintervals, and on each subinterval approximate the initial wave with some simple function. In the end, you will get piecewise continious function, which will be integrable and usable for finding coefficients However, this is kind of bruteforce way and as such will require LOADS of computations (imagine computing integral for every small function you get ). There is most certainly a much better way. Anyway, just thoughts think i have used something like that, by aproximation an unknow funktion with a lot of "tangets" is that the word? by using Eulers method (which is slow, and has to be done in small steps) therefore another method the "rungekutta method" can be used (4 times as quick) but i can remember the procedure. I remember it as difficult, but once u got the method it went pretty fluidly 


Dec 7 2009, 08:43 PM
Post
#19


GMC:er Group: Members Posts: 221 Joined: 13August 09 From: Finland Member No.: 7.514 
Soo, let's deal with every question separately
What "amount of numbers" is Z+ ? dunno the english tranlation and what is an interger? Integer is ummm... a number without decimal point Like 1, 3, 10000 but 10.12 and pi are not integers Z+ is 1, 2, 3,... It is the same thing as natural numbers, only 0 is not included . So the first expression is just math for what we have assumed? am i right? i had been wondering how they got that expression for long First of all, as the guy points out in the video, the expression in general is not true. However, for example if the function is continious at the point x, then the formula will yield correct result at that point (he says more on this stuff in some later lecture, about convergence theorems). The formula itself is something that has to be proved, it did not appear "out of thin air" . Here, we're just assuming that it holds. those funktions on the right of his board (those that equals zero, and pi) should they be obvious (if thats the case, then ill look at them and understand them) or are they to advanced? they seem simple, but i might be wrong. that the same area i below the graph as the one over the graph It is pretty easy to see that those integrals are zero, you just need to use some trigonometric identities . can you explain how you can interchange(meaning switch?) the sigma (at least for finite amounts)? i can see som sort of realtion. that integrals sums up. and sigma writes a lot of sums .. You just use the property of integral  "integral of sum is sum of integrals" Arghhh.. don't have latex here Here: think i have used something like that, by aproximation an unknow funktion with a lot of "tangets" is that the word? by using Eulers method (which is slow, and has to be done in small steps) therefore another method the "rungekutta method" can be used (4 times as quick) but i can remember the procedure. I remember it as difficult, but once u got the method it went pretty fluidly To be honest I've never done numerical methods or any approximation algorithms But isn't Euler's method the method for solving differential equations? 


Dec 7 2009, 10:05 PM
Post
#20


Learning Tone Seeker Group: Members Posts: 616 Joined: 30January 09 From: Aalborg, Denmark Member No.: 6.696 
Ahh thanks
about the Euler method. it makes good sense in my book, since its used for finding tangets (by differentiating) that u aproximate the graph with. but i dont remember it well 


LoFi Version  Time is now: 16th January 2019  01:33 PM 