If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding premade modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
Hilbert Shifter
35 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: Hilbert Shifter
so what can you use that for?
 adamszabo
 Posts: 213
 Joined: Sun Jul 11, 2010 7:21 am
Re: Hilbert Shifter
adamszabo wrote:so what can you use that for?
For example phase alignment of two microphones/pickups put on same source. Naturally, when you have two sounds, you expect the sum of them to be the "sum" of their volumes at all the frequencies. That is the case only if their phases are properly aligned  and that is not just a matter of time alignment. For example dynamic and condenser microphones are generally 90° out of phase, simply because they generate signal by different principle.
With phase alignment tool that has 360° radius (and not just simple 0/180°phase flipping) you can put them in phase much closer. The summing of such sources will then sound much more natural.
Another use is exact opposite  creating stereo imagery. I have used this before  you can create false stereo effect by shifting the phase of one channel of mono signal (that is converted to stereo). Because the phase shift is identical across the spectrum, the sum of the two channels sounds identical to original. So it sounds similar to Haas effect (delaying one channel by <40ms), but without the nasty comb filtering when converted to mono.
 KG_is_back
 Posts: 1110
 Joined: Tue Oct 22, 2013 5:43 pm
 Location: Slovakia
Re: Hilbert Shifter
Ah interesting makes sense! Thanks for the info
 adamszabo
 Posts: 213
 Joined: Sun Jul 11, 2010 7:21 am
Re: Hilbert Shifter
Martin  Yes, that's what I meant when I said the impulse response looked very good! Pretty cool, huh?! It still looks pretty good with Olli's coefficients, but it has much better symmetry with yours.
I'm not sure of a good way to make complex poles out of this structure. I've been trying to figure that out. Stanford has a paper on making efficient linear phase truncated IIR filters, but I don't understand all the heavy math notation. Let me know if you understand any of this paper.
https://ccrma.stanford.edu/~jos/pdf/tiir.pdf
There's one thing I've found that sort of works. You can multiply the input signal by a complex oscillator, then filter it and complex multiply it again after the filter and this give you control of the cutoff frequency and the resonant frequency. It doesn't behave quite like complex poles. Essentially your cutoff controls the DFT window size/shape and the oscillator controls the frequency of interest. In practice, it behaves a bit like a moog style ladder filter but the standard math for complex poles doesn't work. It's pretty cool if you want to compute a DFT at a specific frequency though. You can use this method with any type of lowpass filter.
I used this method to make a harmonic analyzer for helping somebody test guitar pedals. It would generate a sine at a specific frequency and analyze the first 16 harmonics. I used regular lowpass filters (I think I chained a few for a quasi gaussian window). It worked great!
Since we are on the topic of HIlbert transforms, I stumbled on something cool. You can use it to generate harmonics without DC offset for even polynomials and you can autonormalize the harmonics.
Let's call the outputs a and b.
pow = a*a+b*b
rms = sqrt(pow)
x1 = a
a2 = a*ab*b
b2 = a*b+a*b
x2 = a2 / rms
a3 = a2*ab2*b
b3 = a2*b+b2*a
x3 = a3 / pow
Since the denominator is always 1 power less, the polynomial has the same volume as the input (e.g. x^3/x^2 = x). You can blend the harmonics organ style! I think it's much better for simple harmonic generation than using Chebyshev polynomials. Since the hilbert shifter you made has such good performance, the harmonics are very pure. Also notice that inputting two frequencies a fifth apart into the second harmonic, the intermodulation generates a sub octave of the root. This happens normally with 2nd harmonic distortion, but it's very pronounced using this. You could also shift the phase of the harmonics if you wanted to for some reason.
I'm not sure of a good way to make complex poles out of this structure. I've been trying to figure that out. Stanford has a paper on making efficient linear phase truncated IIR filters, but I don't understand all the heavy math notation. Let me know if you understand any of this paper.
https://ccrma.stanford.edu/~jos/pdf/tiir.pdf
There's one thing I've found that sort of works. You can multiply the input signal by a complex oscillator, then filter it and complex multiply it again after the filter and this give you control of the cutoff frequency and the resonant frequency. It doesn't behave quite like complex poles. Essentially your cutoff controls the DFT window size/shape and the oscillator controls the frequency of interest. In practice, it behaves a bit like a moog style ladder filter but the standard math for complex poles doesn't work. It's pretty cool if you want to compute a DFT at a specific frequency though. You can use this method with any type of lowpass filter.
I used this method to make a harmonic analyzer for helping somebody test guitar pedals. It would generate a sine at a specific frequency and analyze the first 16 harmonics. I used regular lowpass filters (I think I chained a few for a quasi gaussian window). It worked great!
Since we are on the topic of HIlbert transforms, I stumbled on something cool. You can use it to generate harmonics without DC offset for even polynomials and you can autonormalize the harmonics.
Let's call the outputs a and b.
pow = a*a+b*b
rms = sqrt(pow)
x1 = a
a2 = a*ab*b
b2 = a*b+a*b
x2 = a2 / rms
a3 = a2*ab2*b
b3 = a2*b+b2*a
x3 = a3 / pow
Since the denominator is always 1 power less, the polynomial has the same volume as the input (e.g. x^3/x^2 = x). You can blend the harmonics organ style! I think it's much better for simple harmonic generation than using Chebyshev polynomials. Since the hilbert shifter you made has such good performance, the harmonics are very pure. Also notice that inputting two frequencies a fifth apart into the second harmonic, the intermodulation generates a sub octave of the root. This happens normally with 2nd harmonic distortion, but it's very pronounced using this. You could also shift the phase of the harmonics if you wanted to for some reason.
 Attachments

 Auotonormalized Harmonics.fsm
 (42.1 KiB) Downloaded 141 times

 Complex oscillator filter.fsm
 (59.67 KiB) Downloaded 145 times
Last edited by cbbuntz on Sat Jan 10, 2015 10:06 am, edited 1 time in total.
 cbbuntz
 Posts: 10
 Joined: Sat May 07, 2011 5:50 pm
Re: Hilbert Shifter
I fixed up the harmonic generator a bit and I realized something. A complex square root is a subharmonic! You have to tell it to flip polarity every 180 degrees because the low harmonic is full wave rectified. I also made a 1.5 harmonic from it too! This complex waveform harmonic generation is really cool.
The subharmonic generator actually is working really well on mixes too! It's not too different from the way Waves LoAir sounds. You need to lowpass the signal to prevent intermodulation. I stuck an 8 pole ladder filter in the schematic to prevent odd behaviors, but I threw the filter together without much thought (the res control is not "correct"). I actually compared it to Waves LoAir and it's hard to tell the difference with the right settings. I'm not sure what method they use.
Anyway, this one has harmonics 16 in addition to 0.5 and 1.5. 1.5 sounds...interesting. Oddly, it's 3/2 power curve that is responsible for a lot of triode harmonics (something like x * sqrt(1 + x) will get you in the ballpark), but it sounds VERY different with complex polynomials. x^(3/2) has monotonically decaying harmonics while this one produces the fifth of the fundamental.
There are a lot of max/min functions in there to prevent div by 0 and NaNs from negative square roots etc. It could probably be cleaned up a lot, but it works as a proof of concept. There's probably a more correct way to unrectify the subharmonic (perhaps using atan(im/re) to keep up with phase?) There's probably some weird code in there from me trying things out of the fly.
The subharmonic generator actually is working really well on mixes too! It's not too different from the way Waves LoAir sounds. You need to lowpass the signal to prevent intermodulation. I stuck an 8 pole ladder filter in the schematic to prevent odd behaviors, but I threw the filter together without much thought (the res control is not "correct"). I actually compared it to Waves LoAir and it's hard to tell the difference with the right settings. I'm not sure what method they use.
Anyway, this one has harmonics 16 in addition to 0.5 and 1.5. 1.5 sounds...interesting. Oddly, it's 3/2 power curve that is responsible for a lot of triode harmonics (something like x * sqrt(1 + x) will get you in the ballpark), but it sounds VERY different with complex polynomials. x^(3/2) has monotonically decaying harmonics while this one produces the fifth of the fundamental.
There are a lot of max/min functions in there to prevent div by 0 and NaNs from negative square roots etc. It could probably be cleaned up a lot, but it works as a proof of concept. There's probably a more correct way to unrectify the subharmonic (perhaps using atan(im/re) to keep up with phase?) There's probably some weird code in there from me trying things out of the fly.
 Attachments

 Auotonormalized Harmonics with subharmonic.fsm
 (132.48 KiB) Downloaded 172 times
 cbbuntz
 Posts: 10
 Joined: Sat May 07, 2011 5:50 pm
Re: Hilbert Shifter
Here's an endless / Shepard tone phaser I made with the hilbert transform. I added an "insanity" mode which self oscillates with tanh saturation in the feedback and a "spaceship" mode that adds a delay to the feedback.
 Attachments

 endless phaser stereo.fsm
 (189.65 KiB) Downloaded 188 times
 cbbuntz
 Posts: 10
 Joined: Sat May 07, 2011 5:50 pm
Re: Hilbert Shifter
That's what they are for, right? Endless Hilbert transform phaser sounds nice, should make it into a vst.

mHz  Posts: 24
 Joined: Sun Sep 05, 2010 6:01 pm
 Location: Eindhoven, Nederland
Re: Hilbert Shifter
Guys, in this example  endless phaser stereo.fsm great phase shift, but i dont understand how it work, code in assambler. Where is i find example 16 order Hilbert shift on Flowstone code? I have example 8 order, but 16 real better.
 borodadada
 Posts: 48
 Joined: Sun Jun 02, 2013 5:58 pm
Re: Hilbert Shifter
The Hilbert shifter in the example does have 16 poles (8 for each arm). Here is a schematic to demonstrate the filter structure: download/file.php?id=4093
 martinvicanek
 Posts: 640
 Joined: Sat Jun 22, 2013 8:28 pm
Re: Hilbert Shifter
Big thank you! Work. As I understand it possible any longer? How do you expect the coefficients ?
 borodadada
 Posts: 48
 Joined: Sun Jun 02, 2013 5:58 pm
35 posts
• Page 3 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 1 guest