Hey guys thanks for the explanation!. goin further in the study of fft and applications, iam designing an oscilator that is capable to go from pure sine tone (fundamental harmonic) to a saw (all harmonics)... 1.I have had trouble finding the amplitudes of the harmonics and relating them to a specific function. 2.Theoretically for it to work propperly i should include infinite harmonics, i am using
[; table sinesum $f1 $f2 $f3 $f4... $f12] to generate the 12 harmonics with different amplitudes in an array and then read it with tabosc4~ but i still don get enough saw sound.
Is it a game of try/error or have any of you guys done it with a larger amount of harmonics.???
along quite well... can anyine pinpoint how to create a list that IFFT~ could interpret as a couple of sinewaves?
thankz a lot!!!!
2006/9/4, Kyle Klipowicz kyleklip@gmail.com:
This is a good explanation.
~Kyle
On 9/4/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
If you did a FFT with a block size larger than an entire audio file, as I understand it, you wouldn't need a window. Looping Martin Luther King's "I Have a Dream" speech (or the audio from the second season of CHIPS, or a recording of penguins in their natural habitat) over and over with a 30-minute pause between each round would technically be a "periodic function", so analyzing it this way would create an accurate representation; unfortunately, you would have exactly one value for each frequency, which tells you nothing about the frequency content at any point. To analyze changing frequency content, you have to take smaller blocks. Repeating these to make them "periodic functions" means the beginning and end of any one block of sound will run together. If this happens to create a continuous function, great, but the chances of that happening with every block are pretty low (if a block is 64 samples, at 44100 samples per second, and the second season of CHIPS is 23 episodes, that's a lot of blocks). Windowing the input simply forces that part of the function to be continuous, by forcing beginning and end to the same value and direction. To prevent the data from that part of the function from being completely lost, alternating FFTs can be taken with windows in opposite phase.
I don't exactly understand what happens with the result, though. Whether the frequency values are averaged, or whether resynthesis is done with the same overlapping. I also don't understand upsampling/downsampling with the block~ object, but I'm not sure that's related.
-Chuckk
Glad this came up!! Kevin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- "Far and away the best prize that life has to offer is the chance to work hard at work worth doing." -Theodore Roosevelt
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Wouldn't the simplest solution be to use a sawtooth wave and then filter it down to the fundamental using subtractive synthesis? Why this other method, other than pedagogical curiosity?
~Kyle
On 9/4/06, mami music mami.music@gmail.com wrote:
Hey guys thanks for the explanation!. goin further in the study of fft and applications, iam designing an oscilator that is capable to go from pure sine tone (fundamental harmonic) to a saw (all harmonics)... 1.I have had trouble finding the amplitudes of the harmonics and relating them to a specific function. 2.Theoretically for it to work propperly i should include infinite harmonics, i am using
[; table sinesum $f1 $f2 $f3 $f4... $f12] to generate the 12 harmonics with different amplitudes in an array and then read it with tabosc4~ but i still don get enough saw sound.
Is it a game of try/error or have any of you guys done it with a larger amount of harmonics.???
- What i wanted in the beginning was to use the object FFT~ but didn´t get
along quite well... can anyine pinpoint how to create a list that IFFT~ could interpret as a couple of sinewaves?
thankz a lot!!!!
2006/9/4, Kyle Klipowicz kyleklip@gmail.com:
This is a good explanation.
~Kyle
On 9/4/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
If you did a FFT with a block size larger than an entire audio file, as I understand it, you wouldn't need a window. Looping Martin Luther King's "I Have a Dream" speech (or the audio from the second season of CHIPS, or a recording of penguins in their natural habitat) over and over with a 30-minute pause between each round would technically be a "periodic function", so analyzing it this way would create an accurate representation; unfortunately, you would have exactly one value for each frequency, which tells you nothing about the frequency content at any point. To analyze changing frequency content, you have to take smaller blocks. Repeating these to make them "periodic functions" means the beginning and end of any one block of sound will run together. If this happens to create a continuous function, great, but the chances of that happening with every block are pretty low (if a block is 64 samples, at 44100 samples per second, and the second season of CHIPS is 23 episodes, that's a lot of blocks). Windowing the input simply forces that part of the function to be continuous, by forcing beginning and end to the same value and direction. To prevent the data from that part of the function from being completely lost, alternating FFTs can be taken with windows in opposite phase.
I don't exactly understand what happens with the result, though. Whether the frequency values are averaged, or whether resynthesis is done with the same overlapping. I also don't understand upsampling/downsampling with the block~ object, but I'm not sure that's related.
-Chuckk
Glad this came up!! Kevin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- "Far and away the best prize that life has to offer is the chance to work hard at work worth doing." -Theodore Roosevelt
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Personal discovery?
On 9/5/06, Kyle Klipowicz kyleklip@gmail.com wrote:
Wouldn't the simplest solution be to use a sawtooth wave and then filter it down to the fundamental using subtractive synthesis? Why this other method, other than pedagogical curiosity?
~Kyle
On 9/4/06, mami music mami.music@gmail.com wrote:
Hey guys thanks for the explanation!. goin further in the study of fft and applications, iam designing an oscilator that is capable to go from pure sine tone (fundamental harmonic) to a saw (all harmonics)... 1.I have had trouble finding the amplitudes of the harmonics and relating them to a specific function. 2.Theoretically for it to work propperly i should include infinite harmonics, i am using
[; table sinesum $f1 $f2 $f3 $f4... $f12] to generate the 12 harmonics with different amplitudes in an array and then read it with tabosc4~ but i still don get enough saw sound.
Is it a game of try/error or have any of you guys done it with a larger amount of harmonics.???
- What i wanted in the beginning was to use the object FFT~ but didn´t get
along quite well... can anyine pinpoint how to create a list that IFFT~ could interpret as a couple of sinewaves?
thankz a lot!!!!
2006/9/4, Kyle Klipowicz kyleklip@gmail.com:
This is a good explanation.
~Kyle
On 9/4/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
If you did a FFT with a block size larger than an entire audio file, as I understand it, you wouldn't need a window. Looping Martin Luther King's "I Have a Dream" speech (or the audio from the second season of CHIPS, or a recording of penguins in their natural habitat) over and over with a 30-minute pause between each round would technically be a "periodic function", so analyzing it this way would create an accurate representation; unfortunately, you would have exactly one value for each frequency, which tells you nothing about the frequency content at any point. To analyze changing frequency content, you have to take smaller blocks. Repeating these to make them "periodic functions" means the beginning and end of any one block of sound will run together. If this happens to create a continuous function, great, but the chances of that happening with every block are pretty low (if a block is 64 samples, at 44100 samples per second, and the second season of CHIPS is 23 episodes, that's a lot of blocks). Windowing the input simply forces that part of the function to be continuous, by forcing beginning and end to the same value and direction. To prevent the data from that part of the function from being completely lost, alternating FFTs can be taken with windows in opposite phase.
I don't exactly understand what happens with the result, though. Whether the frequency values are averaged, or whether resynthesis is done with the same overlapping. I also don't understand upsampling/downsampling with the block~ object, but I'm not sure that's related.
-Chuckk
Glad this came up!! Kevin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- "Far and away the best prize that life has to offer is the chance to work hard at work worth doing." -Theodore Roosevelt
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I did this with a whole lot of harmonics before.
For some reason this patch doesn't work as expected. It gives a flat line for "1". As near as I can tell it shouldn't. A few envelope objects to check give really strange results... nothing until I add something, then it starts working.
Try about 100. sine.pd is the abstraction, sines.pd is the patch.
On 9/4/06, mami music mami.music@gmail.com wrote:
Hey guys thanks for the explanation!. goin further in the study of fft and applications, iam designing an oscilator that is capable to go from pure sine tone (fundamental harmonic) to a saw (all harmonics)... 1.I have had trouble finding the amplitudes of the harmonics and relating them to a specific function. 2.Theoretically for it to work propperly i should include infinite harmonics, i am using
[; table sinesum $f1 $f2 $f3 $f4... $f12] to generate the 12 harmonics with different amplitudes in an array and then read it with tabosc4~ but i still don get enough saw sound.
Is it a game of try/error or have any of you guys done it with a larger amount of harmonics.???
- What i wanted in the beginning was to use the object FFT~ but didn´t get
along quite well... can anyine pinpoint how to create a list that IFFT~ could interpret as a couple of sinewaves?
thankz a lot!!!!
2006/9/4, Kyle Klipowicz kyleklip@gmail.com:
This is a good explanation.
~Kyle
On 9/4/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
If you did a FFT with a block size larger than an entire audio file, as I understand it, you wouldn't need a window. Looping Martin Luther King's "I Have a Dream" speech (or the audio from the second season of CHIPS, or a recording of penguins in their natural habitat) over and over with a 30-minute pause between each round would technically be a "periodic function", so analyzing it this way would create an accurate representation; unfortunately, you would have exactly one value for each frequency, which tells you nothing about the frequency content at any point. To analyze changing frequency content, you have to take smaller blocks. Repeating these to make them "periodic functions" means the beginning and end of any one block of sound will run together. If this happens to create a continuous function, great, but the chances of that happening with every block are pretty low (if a block is 64 samples, at 44100 samples per second, and the second season of CHIPS is 23 episodes, that's a lot of blocks). Windowing the input simply forces that part of the function to be continuous, by forcing beginning and end to the same value and direction. To prevent the data from that part of the function from being completely lost, alternating FFTs can be taken with windows in opposite phase.
I don't exactly understand what happens with the result, though. Whether the frequency values are averaged, or whether resynthesis is done with the same overlapping. I also don't understand upsampling/downsampling with the block~ object, but I'm not sure that's related.
-Chuckk
Glad this came up!! Kevin
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- "Far and away the best prize that life has to offer is the chance to work hard at work worth doing." -Theodore Roosevelt
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I thought you could use the phasor~ object to create sawtooth waves.
By the way, when I read this discussion, I tried to compute the fft of the hanning window, on paper. I've had a little trouble. It's that usual law when you multiply in the time domain, you convolve in the frequency domain. Your windowing functions usually have a lot of low frequencies. There should be some effects from the multiplication (as convolution in the freq domain). I don't get why to use a Hanning window rather than a triangular window, for instance.
Chuck
Hi... well really my intentions are to use a slider to controll the shape from sine to sqare to saw... to get intermediate waveforms with only one slider... i guess sqare works quite good. not so the saw...
Yes you can create a sawtooth wave with phasor, i was just curious how it wold work.
But still can anybody explain how to make a list that the object IFFT~ undestand as sine+amplitude matrix???
I´ve used [print~] to check the output of the FFT~ object. it gives a list of 64 values.... if you input that list to the IFFT~ object it converts that data into resynthesizing a wave form... how can we create our own vaveforms editing that 64 ???
i´ve used pack~ bi¡ut no results.
2006/9/5, Charles Henry czhenry@gmail.com:
I thought you could use the phasor~ object to create sawtooth waves.
By the way, when I read this discussion, I tried to compute the fft of the hanning window, on paper. I've had a little trouble. It's that usual law when you multiply in the time domain, you convolve in the frequency domain. Your windowing functions usually have a lot of low frequencies. There should be some effects from the multiplication (as convolution in the freq domain). I don't get why to use a Hanning window rather than a triangular window, for instance.
Chuck
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
to use the ifft for synthesis, you need to know the amplitude and phase for each frequency, and you need to express it as a complex number.
z=a+b*i, a=Amp*cos(phase) and b=Amp*sin(phase)
fft~ gives two outlets, the left is the real part of the fourier transform, the right is the imaginary part. next thing is, the second half of your fourier coefficients are complex conjugates of your first half (when dealing with real-valued signals) according to the following pattern
F(0) is real (the imaginary part is zero) and so is F(N/2) F(1)=F(N-1)* where * denotes conjugate F(2)=F(N-2)* ... F(N/2-1)=F(N/2+1)*
for a block size of 64, you've got 33 distinct real values (0 to N/2) and 31 distinct imaginary values (1 to N/2-1) to calculate before packing them all up into signals
and there's some limitations. To do things cleanly all of your frequencies need to be ingeter multiples of (sampling freq. fs/ N), the lowest frequency you can achieve with Fourier series on N points
Luckily, your sawtooth and square waves are made up of frequencies in just this way. But you're still limited to JUST the frequencies in your fourier transform (fs/N, 2*fs/N, 3*fs/N, ..., N/2 * fs/N)
It's probably not the best way to do it, for what you're describing.
You want to be able to continuously mix different levels of your saw,
sine and squares as a function of time, right?
I think you'll have better luck by just sync'ing up a phasor~ and an
osc~, and creating your square wave (in phase) by using >~ and <~ on
osc~ and summing the outputs together like
[osc~]
|
[>~][<~]
| |
| [*~] [sig~ -1]
| |
[+~]
output square wave
then just mix your signals together.
Chuck
Chuck! thanks a lot for your explanation, and yes, your solution of mixing is definitely easier. I wanted to take another look at the same issue to begin studying the fft functions. Ill take a deep look into your explanation of fft and ifft. It gives me the complete picture.
dan
2006/9/5, Charles Henry czhenry@gmail.com:
to use the ifft for synthesis, you need to know the amplitude and phase for each frequency, and you need to express it as a complex number.
z=a+b*i, a=Amp*cos(phase) and b=Amp*sin(phase)
fft~ gives two outlets, the left is the real part of the fourier transform, the right is the imaginary part. next thing is, the second half of your fourier coefficients are complex conjugates of your first half (when dealing with real-valued signals) according to the following pattern
F(0) is real (the imaginary part is zero) and so is F(N/2) F(1)=F(N-1)* where * denotes conjugate F(2)=F(N-2)* ... F(N/2-1)=F(N/2+1)*
for a block size of 64, you've got 33 distinct real values (0 to N/2) and 31 distinct imaginary values (1 to N/2-1) to calculate before packing them all up into signals
and there's some limitations. To do things cleanly all of your frequencies need to be ingeter multiples of (sampling freq. fs/ N), the lowest frequency you can achieve with Fourier series on N points
Luckily, your sawtooth and square waves are made up of frequencies in just this way. But you're still limited to JUST the frequencies in your fourier transform (fs/N, 2*fs/N, 3*fs/N, ..., N/2 * fs/N)
It's probably not the best way to do it, for what you're describing. You want to be able to continuously mix different levels of your saw, sine and squares as a function of time, right? I think you'll have better luck by just sync'ing up a phasor~ and an osc~, and creating your square wave (in phase) by using >~ and <~ on osc~ and summing the outputs together like [osc~] |
[>~][<~] | | | [*~] [sig~ -1] | | [+~] output square wavethen just mix your signals together.
Chuck
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Just a thought... the output of a recursive filter from an input of an impulse would be several impulses of linearly changing amplitude at equally spaced intervals, and it would seem like that ought to give some sort of sawtooth if you put it through IFFT.
On 9/5/06, mami music mami.music@gmail.com wrote:
Hi... well really my intentions are to use a slider to controll the shape from sine to sqare to saw... to get intermediate waveforms with only one slider... i guess sqare works quite good. not so the saw...
Yes you can create a sawtooth wave with phasor, i was just curious how it wold work.
But still can anybody explain how to make a list that the object IFFT~ undestand as sine+amplitude matrix???
I´ve used [print~] to check the output of the FFT~ object. it gives a list of 64 values.... if you input that list to the IFFT~ object it converts that data into resynthesizing a wave form... how can we create our own vaveforms editing that 64 ???
i´ve used pack~ bi¡ut no results.
2006/9/5, Charles Henry czhenry@gmail.com:
I thought you could use the phasor~ object to create sawtooth waves.
By the way, when I read this discussion, I tried to compute the fft of the hanning window, on paper. I've had a little trouble. It's that usual law when you multiply in the time domain, you convolve in the frequency domain. Your windowing functions usually have a lot of low frequencies. There should be some effects from the multiplication (as convolution in the freq domain). I don't get why to use a Hanning window rather than a triangular window, for instance.
Chuck
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hey chuck ans everyone thanks again
Actually that was kind of an abbreviated explanation of how the fourier transforms can be used for synthesis. Feel free to ask if there's more you want to know.
Do you have an online resource that you could recommend me to study?
This is a good first stop
http://www.101science.com/dsp.htm
It's not Pd specific, but a good place to get an overview and links to other resources.
On Wed, 6 Sep 2006 10:29:43 -0500 "mami music" mami.music@gmail.com wrote:
Hey chuck ans everyone thanks again
Actually that was kind of an abbreviated explanation of how the fourier transforms can be used for synthesis. Feel free to ask if there's more you want to know.
Do you have an online resource that you could recommend me to study?
By the way, when I read this discussion, I tried to compute the fft of the hanning window, on paper. I've had a little trouble. It's that usual law when you multiply in the time domain, you convolve in the frequency domain. I don't get why to use a Hanning window rather than a triangular window, for instance.
duh....figured that one out. I had the wrong formula for the hanning window....it's pretty obvious
hanning window, y(n)=.5-cos(2*pi*n/N)
so the fourier transform is Y(0)=.5 , Y(1) = -.5 , Y(2)=0 , Y(3)=0, etc...., Y(N-1)=-.5
unlike the triangular window, the hanning window has just three non-zero fourier coefficients. Don't know if that's important...
Chuck
On Mon, 4 Sep 2006, mami music wrote:
Hey guys thanks for the explanation!. goin further in the study of fft and applications, iam designing an oscilator that is capable to go from pure sine tone (fundamental harmonic) to a saw (all harmonics)...
Try a spectrum made like s(k) = k^(-1/p). When p=1 it'll give f^-1, the spectrum of (one kind of) saw wave at base frequency. When p goes towards 0, it goes through k^-2, k^-3, etc. with gradually less powerful harmonics. with p=0, it gives a division by zero, but the limit of s(k) when p->0 is s(0)=1 and s(rest)=0, which is a sinewave.
to produce a spectrum for a frequency multiple of the base frequency, just space out the s(k) using zeros. for a frequency not multiple of the base frequency, a lot of extra processing is necessary.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada