# [PD] spectral mapping, anyone?

Charles Z Henry czhenry at gmail.com
Wed Nov 27 23:15:06 CET 2013

```I think there's a way to do this with fft~ and iem/mtx*~

Your output can be a linear transform of the input in the Fourier Domain.
The columns of the matrix are vectors.  The Nth column contains the desired
output you'd get from having a single '1' in the corresponding Nth input
FFT signal.  Suppose we have a 8-point FFT, and we want to remap
frequencies into the 2nd and 4th bins.  I'll just show the 4x4 matrix here:
0 0 0 0
1 1 0 0
0 0 0 0
0 0 1 1

This is a matrix that projects anything in the 1st/2nd bins into the 2nd
bin, and anything in the 3rd/4th bins into the 4th bin.

The next thing you'd want to do is analyze what the shapes of those vectors
ought to be to handle the interpolation problem that Peiman mentions.  The
energy from each fractional-indexed frequency gets spread across *all*
frequencies.  You need to interpolate to get back the Fourier transform at
a fractional index.  The shapes of the rows/columns isn't just
straightforward, but it's no more difficult than calculating
filter/interpolation coefficients.

The trends are clear to me:  You're reducing the number of dimensions by
projecting sets of frequencies onto individual frequencies.  So, the number
of linearly independent vectors in the rows (the range of the matrix) is
equal to the number of frequencies in the output.  The structure of the
matrix is a sum of u*v' rank-1 matrices the number of which is the number
of frequencies in the output.

Chuck

On Tue, Nov 26, 2013 at 5:48 AM, Eran Sachs <eransachs at hotmail.com> wrote:

> Peiman,
> It works great! I've been messing various sounds all day now, plus there's
> a thing in my computer with Barry Vercoe's name on it which I find oddly
> elevating.
> However, if I understand the wrap function correctly, it substitutes bin
> values for values of other bins through whatever function you apply. But
> the bins are still all derived from the FFT procedure. Or am I missing
> something there?
>
> What I would like to do is to move from bins to partials, so that they are
> essentially mapped to harmonic overtones of a given fundamental according
> to nearest match. Like a clever phase-vocoder Autotune of some kind.
>
> Is there a way to do that, to the best of anyone's knowledge?
>
> Much obliged,
> E.
> ------------------------------
> Date: Mon, 25 Nov 2013 15:12:50 +0000
>
> Subject: Re: [PD] spectral mapping, anyone?
> From: peimankhosravi at gmail.com
> To: eransachs at hotmail.com
> CC: porres at gmail.com; jaime.oliver2 at gmail.com; pd-list at iem.at
>
> yes csound6 should work on windows too as far as I know.
>
>
>
>
> *www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk> || RSS Feed
> <http://spectralkimia.wordpress.com/>*
>
>
> On 24 November 2013 22:06, Eran Sachs <eransachs at hotmail.com> wrote:
>
> Thanks Peiman.
> Alas, I'm living the life of a PC/Windows user. AFAICT, no csound6?
> Z
>
> ------------------------------
> Date: Sun, 24 Nov 2013 20:27:39 +0000
>
> Subject: Re: [PD] spectral mapping, anyone?
> From: peimankhosravi at gmail.com
> To: eransachs at hotmail.com
> CC: porres at gmail.com; jaime.oliver2 at gmail.com; pd-list at iem.at
>
>
> With spectral warping you can do any frequency-based manipulation,
> depending on the transfer function. I have one for pd but it requires
> Csound to be installed and a couple of other externals. See attached. On an
> intel mac and with pd vanilla 4.5.3/4 this should just work out of the box
> as long as you have csound 6 installed.
>
> P
>
>
>
>
>
>
> *www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk> || RSS Feed
> <http://spectralkimia.wordpress.com/>*
>
>
> On 24 November 2013 20:12, Eran Sachs <eransachs at hotmail.com> wrote:
>
> oops, I messed up the names. sorry. Once more, with feeling:
>
> Josep,
> Making harmonic sounds sound inharmonic can be down with spectral
> shifting. Try looking at Hilbert~ or at spec2_shift~ on extended.
>
> But Alexandre, I'd also would be interested in stuff that can manipulate
> the spectrum.
> I also made a little graphic control to all the cross-synthesis objects in
> FFTease. if anyone is interested I can post.
>
> A few years ago I tried to replicate the technique that Trevor Wishart
> refers to as "Spectral Focusing", namely - one that moves the other way -
> from inharmonic to harmonic sonds, by moving from bins to partials (a
> little like FFTease's pvtune~, but moving bins to nearest matching partial
> ).
>
> I'm still looking for such an object. Does anyone have any suggestions?
>
> Zax.
>
> ------------------------------
> From: eransachs at hotmail.com
> To: porres at gmail.com; jaime.oliver2 at gmail.com
> Date: Sun, 24 Nov 2013 21:58:50 +0200
>
> CC: pd-list at iem.at
> Subject: Re: [PD] spectral mapping, anyone?
>
> Alexandre,
> Making harmonic sounds sound inharmonic can be down with spectral
> shifting. Try looking at Hilbert~ or at spec2_shift~ on extended.
>
> But Jaime, I'd also would be interested in that.
> A few years ago I tried to replicate the technique that Trevor Wishart
> refers to as "Spectral Focusing", namely - one that moves the other way -
> from inharmonic to harmonic sonds, by moving from bins to partials (a
> little like FFTease's pvtune~, but moving bins to nearest matching partial
> ).
>
> I'm still looking for such an object. Does anyone have any suggestions?
>
> Zax.
>
>
> ------------------------------
> Date: Sun, 24 Nov 2013 01:05:29 -0200
> From: porres at gmail.com
> To: jaime.oliver2 at gmail.com
> CC: pd-list at iem.at
> Subject: Re: [PD] spectral mapping, anyone?
>
> Hi, I'm Alexandre, I can send you stuff
>
> cheers
>
>
> 2013/11/11 Jaime E Oliver <jaime.oliver2 at gmail.com>
>
> These are older, but I understand E. Lyon might re-release them?
>
> http://www.somasa.qub.ac.uk/~elyon/LyonSoftware/MaxMSP/FFTease/
>
> J
>
>
>
> On Nov 11, 2013, at 7:23 AM, Jeppi Jeppi <jeppiot at hotmail.com> wrote:
>
> Hi,
> just looking for some ready to be used spectral mapping effects
> implemented in pd, anything available?
> Specifically, just a way to slightly remap harmonics to make pitched
> sounds inharmonic.
> There is a paper by Alexandre
> http://www.uni-weimar.de/medien/wiki/images/Dissonance_Model_Toolbox_in_Pure_Data.pdf but
> I couldn't find the link to the sources.
>
>
> Josep m
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
> _______________________________________________ Pd-list at iem.at mailing
> list UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
> _______________________________________________ Pd-list at iem.at mailing
> list UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20131127/b805f330/attachment-0001.htm>
```