Kyma Forum
  Tips & Techniques
  Phase Unwrapping for arcTan

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Phase Unwrapping for arcTan
gustl
Member
posted 10 February 2014 04:31         Edit/Delete Message   Reply w/Quote

HeterodyneFilter.kym

 
Hi there,

I have a problem with the arcTan module. Since the values are limited to -1, 1 I need some kind of phase unwrapping afterwards. I've attached a sound concerning this, have a look at the Waveform the arcTan module (Frequency) is producing. Any suggestions?

Thanks,
Gustl

[This message has been edited by gustl (edited 10 February 2014).]

IP: Logged

SSC
Administrator
posted 10 February 2014 12:12         Edit/Delete Message   Reply w/Quote

AnalysisResynthesisHeterodyneFilter.kym

 
Hi Gustl,

It looked like you were headed toward doing a spectral analysis using the heterodyne filter method, so we went ahead and made one for you. Phase-unwrapper is included in the Sound.

We also added Bandwidth, AnalysisFrequency and a FrequencyDeviation controls. The FreqDev control (called !Scale) lets you go from normal, to monotone, to exaggerated prosody. The !BW can give some beautiful Vocoder-like ringing effects. We also made a pitch-space example, where the analysis frequencies are spaced apart by !Interval rather than harmonic frequencies.

Hope you have fun with it!

IP: Logged

gustl
Member
posted 10 February 2014 13:28         Edit/Delete Message   Reply w/Quote
WOW Thank you so much! That was exactly what I wanted and even more!

I was thinking the whole day about the phase wrapping and my approach was quite similar: delay one sample, difference, etc. but I didn't get it right. The way you did it is very clever by compensating the large jumps and integrating the result - I wouldn't have come up with that.
When I'm finished playing around with that I'll do the PhaseVocoder the other way around with FFT - I'll let you know

Best Wishes,
Gustl



IP: Logged

pete
Member
posted 10 February 2014 15:54         Edit/Delete Message   Reply w/Quote
Hi SSC

Interesting stuff. I notice if you set Interval to 1.0 and scale to -1.0 you get a clean re-synthesis but it doesn't last and drifts like an accumulative error. Putting in a hot parameter in the feedback of "Integrate to get scaled phase" delay means you can move it away from 1 then back to get another hit at the clean re-synthesis.

Maybe it's because I'm running 6.87f4 and you guys are using a newer release (and not getting the problem)?

Also if you change the !FreqLow in the last oscillator to !FreqLow2, you can have a different pitch shifter by off setting the two !FreqLows.

Thanks

Pete

IP: Logged

SSC
Administrator
posted 10 February 2014 16:21         Edit/Delete Message   Reply w/Quote
Thanks, Pete!

When !Interval is set to one, there is probably a lot of overlap of the bins (signal appears in more than one).

Yes, in theory, the Feedback on the Integrator should be a number very slightly less than 1.

Changing the frequency of the resynth oscillator is even more interesting than changing the analysis frequency!

IP: Logged

gustl
Member
posted 08 March 2014 16:08         Edit/Delete Message   Reply w/Quote
Just found this and it really helped me to understand what's going on: http://pcfarina.eng.unipr.it/Differentiation-Integration.htm


IP: Logged

gustl
Member
posted 11 March 2014 04:09         Edit/Delete Message   Reply w/Quote
One thing I still don't understand: Why is MaxMI of the Oscillator set to "Double pi * 4 * ?VoiceNumber" ?

Also today I tried to build a Phase Vocoder using FFT. See the attached Sound for the result. I don't think it's working right but at least you can understand the resynthesized voice Can you have a look at this and let me know what you think?

Greetings from springlike vienna,
gustl

[This message has been edited by gustl (edited 23 April 2014).]

IP: Logged

johannes
Member
posted 23 April 2014 14:26         Edit/Delete Message   Reply w/Quote
hey gustl,

i would love to hear and see your phasevocoder patch but when i try to run it i get an
error message. (see below)
btw. iam using my pacarana with kyma x 6.88f4

ciao and thanks, johannes
_________________________________________________________________________________________

[This message has been edited by SSC (edited 23 April 2014).]

IP: Logged

SSC
Administrator
posted 23 April 2014 15:08         Edit/Delete Message   Reply w/Quote
Hi Gustl,

Could you please re-save and re-post your Sound? There is something wrong with the one you posted.

Thanks!

IP: Logged

gustl
Member
posted 23 April 2014 15:45         Edit/Delete Message   Reply w/Quote
Seems like something went wrong during the upload... Anyway, I will post the Sound again tomorrow!

Oh, and still I don't know why there is Double pi * 4 * ?VoiceNumber...

[This message has been edited by gustl (edited 23 April 2014).]

IP: Logged

gustl
Member
posted 24 April 2014 02:21         Edit/Delete Message   Reply w/Quote

FFT_PVOC.kym

 
Here is the Sound again! My Paca tells me out of realtime when doing the resynthesis with 128 Replicates/Oscillators but it works
Enjoy!

IP: Logged

johannes
Member
posted 24 April 2014 06:56         Edit/Delete Message   Reply w/Quote
iam very curious if there is a way to do phasevocoding (via fft) without using n replicated oscīs.

i guess a oscillatorbank with phase access for each osc would be great for that…

cioa, j

[This message has been edited by johannes (edited 24 April 2014).]

IP: Logged

gustl
Member
posted 24 April 2014 13:49         Edit/Delete Message   Reply w/Quote
Hi Johannes,

I'd rather use the "normal" spectral analysis then. The reason I wanted to do this was to get rid of the oscillatorbank and gain access to single oscillators.

But anyway, I think this is possible: You have to generate a spectral signal like you get when doing the spectral analysis. By doing the square root of the sum of real and imaginary parts of the fft you extract the amplitudes. Similar as I did for the PVoc but you don't need to split and sample & hold. You should end up with a fft size sample long repeating frame where each sample contains the amplitude of its corresponding bin. Then you can use a syntheticSpectrumFromArray to generate the frequency signal. As you probably know these are number of bin * samplerate / fft size. Don't forget that the FFT's first frequency is always 0 (DC) because the bins for e.g. a 512 sample FFT are numbered from 0 to 511.
Feed these two signals with a ChannelJoin (Left = Amp, Right = Freq) into the OscillatorBank and it should work. I'm not in front of Kyma now so please let me know if it really does

IP: Logged

johannes
Member
posted 24 April 2014 16:10         Edit/Delete Message   Reply w/Quote
hey gustl,

...not in front of my paca now, too (until sunday)

anyway, lets see if i get the point: instead of the inverse fft i can use oscbank, fed with the converted amps (left leg), right?

after creating the freq-bins via syntheticSpectrumFromArray with something like ( i-1 * ((sr/2)/(fftsize/2)) there is an extra step needed, i suppose. we will have to "fine-tune" the oscīs in the oscbank. otherwise the freqs are quatized to 256 frequencies in the spectrum. (i guess that we have to add/subtract the phases or a phase related value to/from the binfreqs in order to get the right tunings)
but i have no idea how we can do it. still a kyma and fft newbi

btw: how to do the overlap of the fftframes?

thanks for your input!
ciao, j

[This message has been edited by johannes (edited 24 April 2014).]

[This message has been edited by johannes (edited 24 April 2014).]

[This message has been edited by johannes (edited 24 April 2014).]

IP: Logged

gustl
Member
posted 24 April 2014 17:35         Edit/Delete Message   Reply w/Quote
Right!

You can extract the true frequency from the FFT by using the derivative of the phase but there's no need to do that - instead use the Spectral Analysis tool or the LiveSpectralAnalysis prototype. I doubt that me or you will come up with a better algorithm than SSC

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c