Csound Csound-dev Csound-tekno Search About

[Slightly-OT] Spectral warping

Date2016-08-10 23:00
FromEd Costello
Subject[Slightly-OT] Spectral warping
Sorry if this isn't exactly a Csound question, but when implementing
spectral morphing, if you have audio data as phase vocoder magnitudes and
frequencies, is it simply enough to just scale the frequencies in each bin
according to the warping function?
Cheers
Ed

Date2016-08-10 23:09
FromEd Costello
SubjectRe: [Slightly-OT] Spectral warping
Sorry shouldn't have mentioned spectral morphing in the previous post, no spectral morphing needed, just warping!

On Wed, 10 Aug 2016 at 23:00 Ed Costello <phasereset@gmail.com> wrote:
Sorry if this isn't exactly a Csound question, but when implementing spectral morphing, if you have audio data as phase vocoder magnitudes and frequencies, is it simply enough to just scale the frequencies in each bin according to the warping function?
Cheers
Ed
--
Edward Costello
--
Edward Costello
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-08-11 00:11
FromSteven Yi
SubjectRe: [Slightly-OT] Spectral warping
I'm not an expert, so take this with a grain of salt. :)  But I think
the answer is, it's not that simple.

So from what I understand:

signal -> FFT (real/imag) -> rect2pol (mag/phase) -> conversion to
mag/freq using bin freq and phase data

>From there, if you just multiply the frequencies, you'll get:

mag/freq -> conversion to mag/phase -> pol2rect (real/imag) -> IFFT -> signal

the multiplying of frequencies would just end up altering the phase
for the bin when it gets converted back to mag/phase.  That then gets
used in the resynthesis but using the bin's frequency according to the
FFT (i.e. n / (window_length / 2), which I think is called omega in
the literature?).

For warping the spectrum, you might try instead to map the source
bin's number to a target bin number. So if the warping is 2, bin 2's
amplitude would go to bin 4's amplitude, bin 2's frequency is
multiplied by the warping but written to bin 4's frequency.  If your
warping is > 1, you'd just need to cutoff at the nyquist to not map
values into the negative part of the spectral data.  If warping is <
1, you'll get multiple bins mapping to a target bin. You could then
just overwrite the frequency but sum the magnitude, or over the
magnitude, or... (this is the part where I've seen it go a couple of
ways).

Well, hopefully that makes sense (and is correct!).

steven


On Wed, Aug 10, 2016 at 6:09 PM, Ed Costello  wrote:
> Sorry shouldn't have mentioned spectral morphing in the previous post, no
> spectral morphing needed, just warping!
>
> On Wed, 10 Aug 2016 at 23:00 Ed Costello  wrote:
>>
>> Sorry if this isn't exactly a Csound question, but when implementing
>> spectral morphing, if you have audio data as phase vocoder magnitudes and
>> frequencies, is it simply enough to just scale the frequencies in each bin
>> according to the warping function?
>> Cheers
>> Ed
>> --
>> Edward Costello
>
> --
> Edward Costello
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here