back to list

frequency shifting; was: Yaphi spectrum and tuning

🔗Kees van Prooijen <keesvp@...>

5/9/2009 3:05:05 PM

On Sat, May 9, 2009 at 1:47 PM, Cameron Bobro <misterbobro@...> wrote:

> The Bode frequency shifter from the mid-late 60s shifts the partials by a
constant Hz amount,
> and that's the one Daniel is thinking of.

Thanks for that info Cameron! I must confess, I had never heard of it.
From this site:

http://www.till.com/articles/moog/patents.html#US03800088

it appears to do (almost) exactly the same thing I'm doing, but then with
analog circuitry.
Amazing!

-----------------------------------------
The basic idea is an implementation of the trigonometric identity for the
cosine of the sum of two angles to shift the frequency up:

cos(x + y) = cos(x) cos(y) - sin(x) sin(y)

(Remember this from high school math?) And this variation will shift the
frequency down:

cos(x - y) = cos(x) cos(y) + sin(x) sin(y)

Bode's approach uses:

- a "Dome Filter", two all-pass networks tuned 90-degrees apart. The
input signal goes through these in parallel, effectively providing
cos*x*and sin
*x* signals (relatively).
- two multipliers.
- a quadrature variable frequency oscillator

The latter item, the quadrature variable frequency oscillator, is tricky.
Bode uses a fixed-frequency quadrature sine wave oscillator running at
20kHz, a voltage controlled oscillator with a range of 15kHz to 25KHz, and
with two multipliers beats the oscillators to get a range of -5kHz to
+5kHz. It sounds like a lot of work to go through for a local oscillator,
but it does get you quadrature sine waves, over a wide range, and
through-zero operation.

🔗Cameron Bobro <misterbobro@...>

5/9/2009 3:38:31 PM

--- In tuning@yahoogroups.com, Kees van Prooijen <keesvp@...> wrote:
>
> On Sat, May 9, 2009 at 1:47 PM, Cameron Bobro <misterbobro@...> wrote:
>
> > The Bode frequency shifter from the mid-late 60s shifts the partials by a
> constant Hz amount,
> > and that's the one Daniel is thinking of.
>
> Thanks for that info Cameron! I must confess, I had never heard of it.
> From this site:
>
> http://www.till.com/articles/moog/patents.html#US03800088
>
> it appears to do (almost) exactly the same thing I'm doing, but then with
> analog circuitry.
> Amazing!
>
> -----------------------------------------
> The basic idea is an implementation of the trigonometric identity for the
> cosine of the sum of two angles to shift the frequency up:
>
> cos(x + y) = cos(x) cos(y) - sin(x) sin(y)
>
> (Remember this from high school math?) And this variation will shift the
> frequency down:
>
> cos(x - y) = cos(x) cos(y) + sin(x) sin(y)
>
> Bode's approach uses:
>
> - a "Dome Filter", two all-pass networks tuned 90-degrees apart. The
> input signal goes through these in parallel, effectively providing
> cos*x*and sin
> *x* signals (relatively).
> - two multipliers.
> - a quadrature variable frequency oscillator
>
> The latter item, the quadrature variable frequency oscillator, is tricky.
> Bode uses a fixed-frequency quadrature sine wave oscillator running at
> 20kHz, a voltage controlled oscillator with a range of 15kHz to 25KHz, and
> with two multipliers beats the oscillators to get a range of -5kHz to
> +5kHz. It sounds like a lot of work to go through for a local oscillator,
> but it does get you quadrature sine waves, over a wide range, and
> through-zero operation.
>

So that's how the Bode filter physically does what it does, interesting! They're pretty expensive modules, like 700 Euros? or something. I've only done this in Csound.

🔗Daniel Forro <dan.for@...>

5/9/2009 5:14:47 PM

On 10 May 2009, at 7:05 AM, Kees van Prooijen wrote:

> Thanks for that info Cameron! I must confess, I had never heard of it.
>
> From this site:
>
> http://www.till.com/articles/moog/patents.html#US03800088
>
> it appears to do (almost) exactly the same thing I'm doing, but > then with analog circuitry.
> Amazing!
>

Yes, Bode was electronics wizard.

Daniel Forro

🔗Petr Parízek <p.parizek@...>

5/10/2009 7:17:06 AM

Cameron wrote:

> So that's how the Bode filter physically does what it does, interesting! They're
> pretty expensive modules, like 700 Euros? or something. I've only done this in Csound.

If I've understood correctly some webpages which I read a few years ago, The CSound's "Hilbert" algorithm is actually an IIR filter. This sounds a bit weird to me because a correct Hilbert transform impulse should also contain some non-zero coefficients before the original time, not only after, which is impossible to achieve in IIR filters just because of the way they work. But I think, anyway, the webpages did say something in the sense that it's an approximated version of the Hilbert transform (I have no idea why they don't use a FIR filter for that which is very easily realisable by convolution -- if I wanted, I could happily do that with the old QBasic for Dos). And I even think that the algorithm makes a tiny delay between the original and the frequency-shifted signal (meaning just a fraction of a millisecond), which, in cases of very low frequency shifts, eventually results in phaser-like effects when you add or subtract the two, instead of just the overall volume rising and falling alternately. I've tried the FIR version many times and it always worked perfectly.

Petr

🔗Petr Parízek <p.parizek@...>

5/10/2009 7:33:36 AM

BTW: Is there anyone who could suggest a piece of hardware which is able to do that today in the 21st century? I had a frequency shifter on my "former" PC sound card but that SBLive has stopped working about 3 years ago :-( ... And I was using that effect sooo much in my music then -- now my frequency-shifting times have gone, it seems.

Petr

🔗Daniel Forro <dan.for@...>

5/10/2009 8:07:58 AM

High quality hardware will be pretty expensive if there's some
(harmonizers can do what you want?). Simple pitch shifting algorithms
used to be a part of multieffect audioprocessors, even onboard DSP in
synthesizers.

And why not to go in the direction of some VST plug-in? For sure
there's something. Or non realtime pitch shifting algorithms in
sample editing software... As I don't use it, I can't help you more
in detail.

Daniel Forro

On 10 May 2009, at 11:33 PM, Petr Parízek wrote:

>
>
>
> BTW: Is there anyone who could suggest a piece of hardware which is
> able to do that today in the 21st century? I had a frequency
> shifter on my "former" PC sound card but that SBLive has stopped
> working about 3 years ago :-( ... And I was using that effect sooo
> much in my music then -- now my frequency-shifting times have gone,
> it seems.
>
> Petr

🔗Charles Lucy <lucy@...>

5/10/2009 8:28:27 AM

You might try Melodyne to pitch shift from audio.
My son uses a Logic Plug-in or ToneWorks hardware, and PitchWheel from
QuikQuak

On 10 May 2009, at 16:07, Daniel Forro wrote:

>
>
> High quality hardware will be pretty expensive if there's some
> (harmonizers can do what you want?). Simple pitch shifting algorithms
> used to be a part of multieffect audioprocessors, even onboard DSP in
> synthesizers.
>
> And why not to go in the direction of some VST plug-in? For sure
> there's something. Or non realtime pitch shifting algorithms in
> sample editing software... As I don't use it, I can't help you more
> in detail.
>
> Daniel Forro
>
> On 10 May 2009, at 11:33 PM, Petr Parízek wrote:
>
> >
> >
> >
> > BTW: Is there anyone who could suggest a piece of hardware which is
> > able to do that today in the 21st century? I had a frequency
> > shifter on my "former" PC sound card but that SBLive has stopped
> > working about 3 years ago :-( ... And I was using that effect sooo
> > much in my music then -- now my frequency-shifting times have gone,
> > it seems.
> >
> > Petr
>

Charles Lucy
lucy@...

- Promoting global harmony through LucyTuning -

for information on LucyTuning go to:
http://www.lucytune.com

For LucyTuned Lullabies go to:
http://www.lullabies.co.uk

🔗Petr Parízek <p.parizek@...>

5/10/2009 1:38:56 PM

Daniel and Charles,

thanks for your contributions; but I meant linear frequency shifting as Kees and Cameron were discussing, not ordinary exponential pitch shifting -- i.e. what I'm talking about is the effect which can turn a harmonic triad of 400:500:600Hz into, let's say, totally inharmonic 430:530:630Hz. I was using this effect a lot in my older recordings. Nowadays I can only do that with pre-recorded sounds by using a pair of ring modulators and a hilbert transformer, but no longer in real time.

Petr

🔗Cameron Bobro <misterbobro@...>

5/10/2009 1:52:30 PM

--- In tuning@yahoogroups.com, Petr Parízek <p.parizek@...> wrote:
>
> Cameron wrote:
>
> > So that's how the Bode filter physically does what it does, interesting! They're
> > pretty expensive modules, like 700 Euros? or something. I've only done this in Csound.
>
> If I've understood correctly some webpages which I read a few years ago, The CSound's "Hilbert" algorithm is actually an IIR filter. This sounds a bit weird to me because a correct Hilbert transform impulse should also contain some non-zero coefficients before the original time, not only after, which is impossible to achieve in IIR filters just because of the way they work. But I think, anyway, the webpages did say something in the sense that it's an approximated version of the Hilbert transform (I have no idea why they don't use a FIR filter for that which is very easily realisable by convolution -- if I wanted, I could happily do that with the old QBasic for Dos). And I even think that the algorithm makes a tiny delay between the original and the frequency-shifted signal (meaning just a fraction of a millisecond), which, in cases of very low frequency shifts, eventually results in phaser-like effects when you add or subtract the two, instead of just the overall volume rising and falling alternately. I've tried the FIR version many times and it always worked perfectly.
>
> Petr
>

Yes, the Hilbert in Csound is imperfect, they mention it in the documentation. The guy who writes the wonderful Straightliner VST instrument told me that he uses the theoretically perfect FIR hilbert in his (superb) stereo spread algorithms, so it obviously works in realtime and can be coded in C.

When I said I do this in Csound, I meant longhand. :-) Like adsyn, and piles of oscillators, and so on. Pain in the butt, but total control.

🔗Kees van Prooijen <keesvp@...>

5/10/2009 2:26:52 PM

A theoretically perfect FIR implementation of the discrete Hilbert transform
has an
infinite kernel size, and is non causal, so it's impossible to work in real
time. Or am
I misinterpreting something here?
In a realistic implementation, the better the approximation, the longer the
time delay.
I implemented it in C++ if anybody's interested.

On Sun, May 10, 2009 at 1:52 PM, Cameron Bobro <misterbobro@...>wrote:

> Yes, the Hilbert in Csound is imperfect, they mention it in the
> documentation. The guy who writes the wonderful Straightliner VST instrument
> told me that he uses the theoretically perfect FIR hilbert in his (superb)
> stereo spread algorithms, so it obviously works in realtime and can be coded
> in C.
>
>

🔗Cameron Bobro <misterbobro@...>

5/10/2009 2:40:55 PM

--- In tuning@yahoogroups.com, Kees van Prooijen <keesvp@...> wrote:
>
> A theoretically perfect FIR implementation of the discrete Hilbert >transform
> has an
> infinite kernel size, and is non causal, so it's impossible to work >in real
> time. Or am
> I misinterpreting something here?
> In a realistic implementation, the better the approximation, the >longer the
> time delay.
> I implemented it in C++ if anybody's interested.

"Realtime" here means "with some microscopic latency". Hm, it's beyond me, but perhaps the fact that it's essentially a 1024 partial additive synthesizer has something to do with being able to implement it practically?

>
> On Sun, May 10, 2009 at 1:52 PM, Cameron Bobro <misterbobro@...>wrote:
>
> > Yes, the Hilbert in Csound is imperfect, they mention it in the
> > documentation. The guy who writes the wonderful Straightliner VST instrument
> > told me that he uses the theoretically perfect FIR hilbert in his (superb)
> > stereo spread algorithms, so it obviously works in realtime and can be coded
> > in C.
> >
> >
>

🔗Petr Parízek <p.parizek@...>

5/10/2009 3:07:02 PM

Cameron wrote:

> "Realtime" here means "with some microscopic latency". Hm, it's beyond me,
> but perhaps the fact that it's essentially a 1024 partial additive synthesizer
> has something to do with being able to implement it practically?

Here I can't speak for myself because I only do that with pre-recorded sounds, which allows me to use filters as large as I can load into the actual impulse memory used by CoolEdit. Sometimes I was even using such terribly long delays as 4 seconds or similar (which actually results in an 8-second impulse because the filter has to be symmetric). :-D

Petr

🔗Petr Parízek <p.parizek@...>

5/11/2009 1:15:43 AM

Daniel wrote:

> It's necessary to distinguish Frequency Shifter (shifting all harmonics/non harmonics,
> that means changing timbre) and Pitch Shifter (shifting the pitch, of course

Exactly. And that's why I said I was trying to find a piece of hardware that could work as a frequency shifter, not a pitch shifter.

Petr