Frequency/Pitch Shift
Len Sasso wrote:
Has anyone got a clever way to make a frequency shifter (i.e. leaving only the upper sidebands from ring modulation)? I know you can come close by HP filtering the output of the ring modulator, but it's not really satisfactory.
I thought I could do it mixing the output of two ring modulators with the modulator and carrier reversed since this should reverse the phase of the lower sidebands only, but it doesn't seem to work. Any ideas?
Llare wrote:
I've noticed that substracting a filtered signal X from an unfiltered signal X does not seem to produce the kind of result it theoretically should. Sometimes even perfectly identical structures produce different sounding results. I've also discovered similar problems when substracting unaltered signals from ring and FM modulated signals.
Might it perhaps be that there are signal delays (that are invisible and unpredictable to the user) between the modules in the NM DSP algorithms?
Maybe this subject has already been discussed here? (I'm kinda new here...) Anyway, if someone's got some knowledge on this one, I (too) would really love to hear about it.
Jim Clark wrote:
This is indeed one of the main problems. It is made more complicated by the fact that the "ordering" of computation of the modules affects the relative delays in signals. It might only be a few sample periods, but this is enough to screw up the phase relationship between the signals.
In Reaktor, the order of computation is set by the order in which modules are entered, so you have some control. I don't know what scheme is used in the NM.
S. Harrison wrote:
These sorts of effects are definitely something I meant to get into... but if we're unable to know the computational delays between the units then we probably wont be able to do this sort of stuff.
Given the computational delays, though, we could then add in an appropriate <x> sample delay unit in the faster route of the instrument in order for it to sync with the slower route.
R.E.Hordijk wrote:
Spectrumshift occurs when a signal is first split into two signals with a phaseshift of 90 degrees. These are multiplied with a relatively low sinewave and it's 90 phaseshifted equivalent and then added together. The 90 degrees shifted sines are easily generated by syncing two FMB slave sineoscilators with a pulse of 25 % from a OSC A module. For one of the oscillators the syncing signal needs to be inverted before connecting to the syncinput. But the difficult or maybe impossible thing is to make a !_frequency_independent_! phaseshift of 90 degrees in the (complex) signal that needs to be processed. The traditional way to do it is to split the input signal into several frequencybands by means of a bank of bandfilters, e.g. 33 1/3 octave filters. The output of each band is fed into two channels of allpass filters that are detuned in a way that at the end of the two paths the relative phaseshift is more or less 90 degrees and multiplied and mixed with the two 90 degree shifted sinewaves. 2 x 2 allpass filters should give a phase error within 1 degree for 1/3 of an octave. The outputs of all 1/3 octave channels are mixed to get the endresult. This should give a high quality spectrumshifter. Only one time in my life, maybe fifteen years ago, I heard a good spectrumshifter at the Dutch Institute on Perception Research, think it was a Bruel&Kjaerr, and I was told very, very expensive. The effect was quite stunning. Regrettably there is no allpass filter in the Modular. Allpass filters can be constructed by adding the three outputs of a 12 dB filter together, but the phaseresponse is not as good a a true allpass filter. Using two parallel phaser modules also seems to be no option as some internal mixing with the input signal is done and we need a very clean, only phaseshifted signal.
So IMHO it has nothing to do with computational delays in the modules but the fact that a frequency independent phaseshifter is such an incredible complex circuit to make.
Just looked up what Hal Chamberlin had to say about spectrumshifters in his all time favourite book "Musical Applications of the Microprocessor" (1980 Hayden Press ISBN 0-8104-5753-9), as he describes a "poor man's spectrum shifter". This is basically the oldfashioned scrambler/descramber. Low frequency response is the issue and is dependent of the quality of the filter to suppress one sideband. As the low frequencies lie so close to the modulator frequency in the inverted spectrum we need a very sharp "brickwall" filter. In my example I used six! 24 dB filters and an additional 24 dB bandreject filter on the modulator frequency. As you can hear one sideband is audibly much weeker than the other for input frequencies around 1 kH to 2 kH if the shift is not to high. The quality is so poor however that although the upper harmonics seem to shift, the fundamental is still not sufficiently suppressed to prevent the ringmodulator effect where you hear one sideband shift up and the other shift down. As the input frequency gets lower this gets worse.
So no good quality spectrumshifter possible...
IMHO the best way to go now would be to do realtime high resolution Fourier analysis, add a constant to all the analysed frequencycomponents and do the reverse Fourier. Maybe that's possible with Kyma software on a Capybara.
S. Harrison wrote:
Heheh cool, let me know how it turns out. I'm guessing that the delay unit probably won't let you get as accurate as you want..
Speaking of which, thats another thing I'd like to have in NM2 (Nord Modular 2) - the ability to enter explicit values for all parameters.
Obviously there are domain restrictions, but for an LFO for example.. all the knobs only have 127 possible settings - so if one notch on the knob is 1.56 hz, and the next notch is 1.67 hz, then I can never make a 1.6hz lfo.
Being able to explicitly enter values would be very useful, especially in the above case where we're talking about delaying a route by only 2 or 3 samples. I just wonder how they'd implement it..
JR.E.Hordijk wrote:
The delay is much more accurate that the 127 knobsettings. Actually by means of very clever interpolation very fine tuning is possible by means of the blue control input. That's also logical otherwise a lfosweep would definitely have little audible steps and it would be impossible to tune the delay to an actual musical scale, which is possible using the keyboardscaler module.
To finetune see the examplepatch where an integer part and a fractional part for the delay can be set by two constant modules and a control mixer. Turning the fractional part knob clearly influences the timedelay.
Llare wrote:
Perhaps it might be possible to make an auto compensating ("tuning") phase correction system. The delay line anyway takes 8% so a few additional cycles here or there - who cares! This was a joke...
JI honestly think we'd be much wiser if we concentrated on things that we CAN do with the Nord Modular WITHOUT sacrifying system resources on things that are ALMOST impossible or AT LEAST HIGHLY IMPRACTICAL to realize on this platform.
Of course I must admit that it's tempting to try to find out new ways of SYNTHESIZING sound on the NM. Basic oscillation, distortion, FM, various phasing effects, standard filters and suchlike just can't offer anything new - THEORETICALLY. (But in practice something new and interesting sounding almost always comes up! I mean in case ours ears are open to hear instead of trying to reach something that does not exist.)
But I still want to try to make something NEW!
At the moment I'm very much into "self adjusting feedback systems". I should probably send some example patches to explain what I mean but unfortunately all my paches are at home. (I'm at the office right now) But I'll try explaining this as I'd love to hear if there are similar patches in the archives.
For this kind of patches I use a kind of simple "physical models" of some sort of pendulums. Or just "variables" (made of mixers with feedback connections for example) that always try (Damn I can't find the correct words! I hope you understand anyway...) to return to their mid position when - er - shaken(?). Anyway, the idea is to make elements that INTERACT IN TIME with each other. (Normally in DSP systems that have no RAM available [like in the NM] for signal buffers everything tends to happen IMMEDIATELY. But this sort of models make it possible to design dynamic systems where potential and kinetic "energies" transform from one to another and travel through the whole system. The aim is to make the hole system pulsate in audio and sub audio frequencies. (Sub audio frequencies could of course be used as LFOs to modulate sound that is created entirely separately from the "dynamic" parts. That is, if one, for some peculiar reason, wishes to do such silly things...)
The basic principle of "self adjusting feedback systems" (actually this is just this one idea that I happen to have in mind at the moment - nothing more...) is that elements react to each other with delay and tend to OVER REACT (over steer?).
A crude example:
Sound source (A) has a variable amplitude on which an actively sensing level meter and "pulse cannon" (B) can send pulses either to attenuate or to amplify sound source (A)'s amplitude. The idea is that it takes some time for a pulse to travel and make effect on (A) and that the pulse is always too strong PLUS it causes the amplitude of sound source (A) to temporarily bounce UP after the attenuating signal has hit (A) and caused it to hit the bottom.
And this strange play goes on and on and there's no end. Actually I haven't made exactly this kind of patch and the description wasn't probably very worderful either as I'm still very tired...
Jim Clark wrote:
What you need to do to get SSB is (and I am quoting from a textbook here) is to use two balanced modulators (ring modulators) where BOTH the carriers and modulator signals are shifted by 90 degrees. That is, into the first Ring Modulator you put the baseband signal s(t) and a carrier sine wave. Into the second Ring Modulator you feed the baseband signal shifted by 90 degrees and a carrier cosine wave (i.e. shifted 90 degrees from the sine carrier).
You then add the outputs of the two Ring Modulators.
As noted previously, the hard part of this approach is getting a phase shifter that will provide a 90 degree shift over a wide frequency range.
The text I looked at has a reference to another method which avoids the need for wideband phasers, but uses 4 Ring Modulators. The reference is to a paper published in 1956 and I haven't tried to find it.
There is also an approach to "Single Side Band FM" that a student of mine Did many years back, based on a communication theory paper from the 60's. It involves multiplying an FM signal by the log of it's Hilbert transform magnitude (which acts like a wideband phase shifter). This tends to suppress the lower sidelobes of the FM signal. Maybe I will try to implement this in a patch. I will have to dig out our report and brush up on the theory.
Len Wrote:
Hi Rob -
Maybe it comes down to the same thing - it's hard for me to tell from the patch - but I was simply trying to isolate one 'side' of a ring modulated signal (i.e. achieve single sideband modulation) by cancelling the other side. I seemed to me that this should be possible by switching the modulator and carrier (at least in the case of two sine waves). With the modulator frequency of M and the carrier frequency of C, I think the sidebands are at C+M and C-M in one case and M+C & M-C in the other which means (I think) that the lower sidebands C-M and M-C should be 180 degrees out of phase and cancel when mixed. But in practice in the NM this doesn't happen and I was curious why.
Kris Northern wrote:
Over the weekend my friend and I were up to some buffoonery and tried to make the modular pitch shift our voices through the inputs with no luck. Does anyone have any hints? Or would this require too much realtime processing?
David Lacey wrote:
Theres just not enough delay available in the nord (unless maybe by using 3 slots in an out->in->out->in->out configuration?)
I tried once too, envisioning several delay lines that cycled through loading stages (where they are fed by the audio in) then pitched up or down to match the shift. I probably screwed up the logic anyway, but mostly I think you need larger delay lines to make it work. I got some interesting distortions though... wonder if those patches are still in my NM?
Wish I had a nord at work so I could check. We should add a 'How do I get the accounting department to let me expense a Micro Modular for use at work?' section to the FAQ in progress....
James Clark wrote:
There have been a number of good pitch shifter patches posted. I don't have any of them here at work, but you can check the archives. They are not perfect, and have clicks and stuff, but they do shift your voice (or music) up and down.
Kees van der Maarel wrote:
I made a pitch shifter about half a year ago. Use knob 3 to shift the pitch up or down.
Ethanzer0 wrote:
Does there exist a patch for frequency shifting Audio Input?
Lennart Regebro wrote:
Isn't that what the pitch shifter patch does?
Ethanzer0 wrote:
Frequency shifting is more closely related to ring modulation than pitch shifting. I cannot give you a scientific explanation, however, I do know that the two are very different.
Lennart Regebro wrote
:Ah, when you say frequency shifting you mean the type where you add a fixed frequency amount to another frequency, so that all frequencies are moved with the same number of hertz, rather than the same number of notes.
This is not only closely related to what ring modulator does, it's *exactly* what a ring modulator does
J Although most ring modulators (including the one in the NM) will give you both the sum and the difference and not only one of them. This may be fixable if you build your own ring modulator from more basic modules.Rob Hordijk wrote:
Actually there's pitchshift and spectrumshift, two in a way related but in fact different effects. With pitchshift you shift a tone up or down with all its harmonics, this effect is generally available on many effect machines. Its an effect based on either a clever manipulation of a somewhat longer delayline or on a "Fourier series analysis/resynthesis" principle.
Spectrumshift (technically called "single sideband modulation") you can do with two sinewaveoscillators 90 degrees out of phase, a phaseshifting allpass filter that shifts all frequencies on one output 90 degrees in respect of another output and a couple of ringmodulators combining the phaseshifted signals with the sinewaves. The effect is that all frequencies (=harmonics) are shifted up or down a fixed number of Hz, this number being the frequency of the two sinewaves.. This means that the stronger the effect the more the harmonics loose their harmonic relation. (This in contrast to pitchshifting!) So the effect is that you "morph" a sound between the dry sound and a "ringmodulation" effect sound at extreme shifts. A shift of a few Hz can e.g. make a static synthetic sound more lively. The problem is to make the phasedifference filter, such a filter only works right in a limited frequencyrange, so a bank of bandpassfilters, each followed by the phasedifference filter giving approximately 90 degrees phaseshift for that band should be used to make the effect high quality. But now it gets really interesting if you start to randomly modulate the shifts in each band. This can give very beautiful "very big choir" chorus effects. If you use two spectrumshifters in each band, one shifting in the reversed direction of the other and mix those to left and right channels, the effect becomes very spatial as well. One would typically use 33 1/3 octave bandpass filters, 66 spectrumshifters and 33 random modulators. In the calculations one can modify a spectrumshifter to give two outputs, one shifted up and the other shifted down, so only 33 are needed. In addition you can give every band a random(ly modulated) delay of 10 msec with random predelays between 0 and 300msec for each band. This shifts the formants in time in relation to each other and thickens the effect even more. Its clear that you need a lot of DSP power and memory for the 33 delaylines to do this!
Some attempts by some people (including myself) were made to make a frequency shifter patch, but by lack of a good allpass phasedifference filter on the NM the results were not of very high "quality". Still interesting sounding, though... Have a look in the patch archives.
A traditional pitchshifter works by filling a fixed length delayline with a fixed rate and reading it with a variable rate. The rate difference causes the pitchshift. At a certain moment the reading point overhauls the writing point in the delayline and this would give a severe click. To compensate for this one calculates the absolute difference between the reading point and the writing point in the block of memory making up the delayline. If reading and writing point are the same the result is 0 and if they are at maximum absolute difference the result is normalized to 1 (absolute difference in samples divided by half the number of samples in the block of memory). The result value is multiplied by the read value from the delayline and that's the output. But this also gives AM modulation to the output. To compensate for this one actually reads two values instead of one from points exactly half the length of the delayline apart. This means that if the multiplication factor of one of them is 0 it is 1 for the other, so the AM is cancelled out. The lenght of the delayline influences the quality a bit and that's why you can find optimization parameters for different intervals on the pitchshifter effects in the better effects machines. These parameters in effect set the lenght of the delayline (think of the phase differences between the waveforms from the two reading points) and the number of reading points (you need at least two, but you can imagine that using more reading points and different windows can increase the quality).
The Fourier series analysis/resynthesis makes a spectral plot (analyses) of a monophonic! sound, extracts the fundamental (the first peak in the spectral plot) and uses the spectral plot to synthesize a signal with a different fundamental. This way you can do pitch correction, as the new pitch does not necessarily have a fixed frequencyratio to the original pitch as with the delayline method. If the analysis and resynthesis is done with enough resolution the result can be very natural. Or you can abuse it to make Cher effects (oh no, not again...!) Plosives, etc. are a bit of a problem as they do not have a fundamental, so there might be a "voiced/unvoiced" detection algoritm as well. One would typically do 50 to 100 FFT transforms a second.
Lennart Regebro wrote
:Yup. It's ringmodulation with some clever bits added to remove one sideband. Very neat, quite doable in the modular and in fact just what the FrequencyShifter patch does, as far as I can see
J