can someone please explain in layperson's terms what "sample and hold" is?

How to do this, that and the other. Share, learn, teach. How did X do that? How can I sound like Y?
RELATED
PRODUCTS

Post

aciddose wrote:http://xhip.net/effects/?p=Quantizer

Image

Quantizer
A combination of a time axis (sample and hold) and amplitude axis ("bit reduction") quantization.

Parameters
Sample & Hold

Rate - The sample-rate at which to sample&hold the input. 400hz to 40khz.
Jitter - How much to modulate the fractional sample position, up to one sample period.

Bit Reduction

Bits - The number of bits which represent the amplitude axis from -inf to 0db, 2 to 16, including the sign.
Dither - How much white-noise to mix before amplitude quantization.
Zero - Whether the amplitude axis quantization uses two's complement. The result is either to square a low-level signal (2sc) or to zero it.

Comments

Quantization n. A procedure in which a value is limited from a continuous range of values (real numbers) to a set of discrete values (integers).

In the case of the quantizer plugin we are actually taking one set of discrete values and reducing them to another set of discrete values.

https://soundcloud.com/xhip/feeling-nothing
I see. I can hear the artifacts of the process I think. With Sugar Byte's Factory, he is getting some really smeared and interesting results but I guess that is due to the introduction of effects and not the interpolation of the samples being held.

Post

killmaster wrote:
Wow! thanks for the great explanation!! I think I'm actually starting to grasp it...
Good stuff, and you're welcome!

Hopefully the diagram of the sine wave I posted above makes a bit more sense now. If you look at it again, the sine wave is the underlying waveform being fed into into the S&H module, and the blue 'stepped' waveform is what you get after sample and hold. The sample and hold rate (trigger rate) determines the number of steps - each time the S&H trigger goes off, it creates a new step that 'freezes' the current value of the sine wave until the next trigger hits which freezes *that* value, and so on and so on. That's why the beginning of each 'step' on the blue waveform touches the sine wave at the left of the step - because that was the value of the sine wave when the trigger went off.

With audio rate oscillators (or any audio) and audio rate sample and hold triggers, it sounds a bit like sample rate reduction in a bitcrusher plugin. With LFOs and low frequency sample and hold triggers, you get that 'jumping' LFO shape you'll probably be familiar with.

Post

Although it may not matter, I'd like to point out that in analog S&H you don't hold the waveform, you hold the voltage of the waveform at the time of a gate event. That voltage will remain (held) at the output for some duration before being replaced at the next sample event. There are many offshoots of the basic capability on the hold side. But, the idea is that with noise you get a "random" voltage, which is why it is common to use noise as the primary source to sample. But, most modular S&H modules simply have a voltage input, a gate input and the hold output. You can then use things like slew modules to slew (slowly change) from one held voltage to the next. By doing so you can make a Random LFO out of a "noise" input. One of the most basic uses of S&H.
If you have to ask, you can't afford the answer

Post

killmaster wrote:Would really like to understand this and am having a hard time wrapping my head around it.

thanks!

Greg K.
Traditionally in analog systems, the sample and hold circuit has two inputs; the signal that is being sampled, which can be anything, and the clock signal, which is usually some sort of low frequendy pulse or square wave. When the receives a rising edge from the clock, it samples the input signal and holds that voltage until it takes the next sample. If the input signal is noise, the output will be a random stepped voltage. If the input is an ascending sawtooth, the output will be an ascending sequence of discrete steps; a descending sawtooth will give a descending sequence. A sine or triangle input will give a rising and falling sequence. A lot of variety can be derived by varying the frequency of the input signal, the clock signal, or both.

A good example of a sample and hold circuit can be found on the ARP Odyssey and 2600. You can try demos of the GForce Oddity (http://www.gforcesoftware.com/products/oddity2) and Arturia ARP2600 (https://www.arturia.com/arp2600v/resources).

A lot of softsynths simply have an LFO waveform labled 'random' or 's&h' but an actual sample and hold function is a lot more versatile.
I wish I could sing as well as the voices inside my head...

http://www.cdbaby.com/darkvictory

Post

It's unfortunate they don't point out it is in fact a low-pass RC filter.

They often show the capacitor and a switch, but fail to describe the fact that the switch is merely a zero and infinite ohm resistor in the ideal case and in reality the range is often more like <100 ohm to >10 mega ohm.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

DocAtlas wrote:A lot of softsynths simply have an LFO waveform labled 'random' or 's&h' but an actual sample and hold function is a lot more versatile.
The problem with this is that unfortunately you're sampling at an arbitrary point between samples, while the signal itself is represented only by those fixed samples.

In order to sample at an intermediate point an interpolating filter is required both for the sample and the output pulse generated.

The vast majority of sample & hold effects don't deal with this. Xhip Quantizer does apply interpolation for both the input and output which provides much deeper notches and cleaner sound with less noise and aliasing outside the range expected for the s&h.

It isn't really very practical to apply such an effect to arbitrary signals though as it is quite expensive to process the high quality interpolating filters.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:It's unfortunate they don't point out it is in fact a low-pass RC filter.

They often show the capacitor and a switch, but fail to describe the fact that the switch is merely a zero and infinite ohm resistor in the ideal case and in reality the range is often more like <100 ohm to >10 mega ohm.
LOL, that's because 99.9999% of the people that use a synth wouldn't know or care. That want to know how it works, not what it is. Telling the OP that it's a low-pass RC filter would not tell him anything. :) :hihi:
If you have to ask, you can't afford the answer

Post

Actually telling him anything else would fail to actually tell him anything. What I've told him is a fact and the only fact which exists. There is no other truth to be revealed.

So if you're incapable of understanding what a low-pass filter is, you're also therefore incapable of understanding a sample & hold. They're the same thing.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

aciddose wrote:Actually telling him anything else would fail to actually tell him anything. What I've told him is a fact and the only fact which exists. There is no other truth to be revealed.

So if you're incapable of understanding what a low-pass filter is, you're also therefore incapable of understanding a sample & hold. They're the same thing.
The smilies were there because I was teasing you :D
If you have to ask, you can't afford the answer

Post

I know, and I agree and understand where you're coming from. I think it's a fundamentally different way of thinking that a large number of people seem to exhibit.

When I ask "what is: X?" I'm looking for an answer like the sort of answers I provide. "A sample & hold is a low-pass filter taken to an extreme; where the hold state is the absolute minimum cutoff frequency while the sample state is the absolute maximum cutoff frequency. The cutoff is switched between these states to allow the filter to either follow the input signal or to cease movement entirely and hold at a fixed position."

Most people would start discussing how it sounds or which synthesizers use it and how it's applied. Those are trivial and heedless details that don't actually answer the question itself but instead divert attention elsewhere.

That's sad but it is reality. Without being able to think differently people won't ever come to actually understand anything and so asking such questions would only be a waste of time.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

It's a fundamental thinking difference between people who just want to use things and people that like to make things.
If you have to ask, you can't afford the answer

Post

What confused me is the use of "sample"; I couldn't get past the associations I already had for the word (stuff like drum or piano samples). What helped me is to phrase it as "measure and hold" instead. Basically, it's taking some input, measuring the value, then holding that value until the next measurement happens. The effect that has depends on what the value is being passed to.

Post

A link to the classic 'S&H to pitch" sound shouldn't miss in such a thread I guess. :D

http://www.synthmania.com/Famous%20Sounds.htm (number 2)

Post

That's when you ask the girl that you took home last night from the club to be your girlfriend.

Post Reply

Return to “Production Techniques”