hi
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument was: it should be possible to set the values of each sample so, that the resulting signal would be similar to a digitized analogue signal with a shorter than 1 sample delay.
Does anybody know a good explanation for this problem?
i konw, this haven't got anything to do with pd. but i think you are the right people to ask. by the way: if it is possible, how would a realization in pd look like?
thank you for helpin me
roman
On Fri, May 14, 2004 at 12:35:17AM +0200, Roman Haefeli wrote:
hi
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument was: it should be possible to set the values of each sample so, that the resulting signal would be similar to a digitized analogue signal with a shorter than 1 sample delay.
supposing your interpolating delay wants to output something after 0.5 samples of time have passed...it will have to wait, its output being quantized by the overriding samplerate.. with PD's non-signal data - perhaps numbers specifying the delay time - you are not quantized by the samplerate, but by the 'block size' or aroudn 1.45 ms. there are ways around this involving some external libs, like iemlibs' t3 i think..
i've heard that certain programs like SynthEdit calculate all control data at the audio rate. to some extent you can already do this with pd by just using signal objects for everything, but it would be very cool if a coding genius takes up the challenge of redoing the m_* to support something like that so that control changes happen immediately, while also not bothering to calculate every object 44100 times a second if nothing has changed further up the chain...
Does anybody know a good explanation for this problem?
i konw, this haven't got anything to do with pd. but i think you are the right people to ask. by the way: if it is possible, how would a realization in pd look like?
thank you for helpin me
roman
PD-list mailing list PD-list@iem.at to manage your subscription (including un-subscription) see http://iem.at/cgi-bin/mailman/listinfo/pd-list
On Fri, 14 May 2004, Roman Haefeli wrote:
hi
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument was: it should be possible to set the values of each sample so, that the resulting signal would be similar to a digitized analogue signal with a shorter than 1 sample delay.
It's certainly possible to get bandlimited fractional sample delays, using all pass filters. I don't remember if the minimum possible delay of the filter (if it can give a fractional delay less than one sample). But this is the technique used to tune physical waveguide models.
Try searching the web for "fractional" "waveguide" "allpass" or the like.
Larry Troxler
From my (not 100%) memory of signal processing, to sythesise an FIR filter
with a pure delay of a whole number of samples, you can get the impulse response by sampling a sinc function with the correct delay and sample rate.
It happens that sampling a sinc with a whole number of samples delay, you get an IR with one sample of amplitude 1 at the sinc's centre peak, and the rest of the sample points fall on zeros of the sinc function, so the IR has an amplitude of 0 at all other points. Thus you get the single unit impulse function for the impulse response.
I recall that it is likewise possible to synthesise a fractional delay filter by sampling a sinc function with the correct delay- which if fractional, gives you an infinite impulse response of mostly non-zero values, which of course is impossible to use as a real filter. Then you can go about creating variously optimised bandlimited methods of approximating this response for example by using different windows to sample the sinc.
There are also other methods such as using polynomial interpolation or splines.
There are some notes on the mathematics of this here and on other pages linked from here: http://ccrma.stanford.edu/~jos/Interpolation/sinc_function.html
Nick
-----Original Message----- From: pd-list-admin@iem.at [mailto:pd-list-admin@iem.at]On Behalf Of Larry Troxler Sent: Saturday, 15 May 2004 1:33 AM To: Roman Haefeli Cc: post pd-msg Subject: Re: [PD] smallest possible value of a delay-time
On Fri, 14 May 2004, Roman Haefeli wrote:
hi
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument
was: it should
be possible to set the values of each sample so, that the
resulting signal
would be similar to a digitized analogue signal with a shorter
than 1 sample
delay.
It's certainly possible to get bandlimited fractional sample delays, using all pass filters. I don't remember if the minimum possible delay of the filter (if it can give a fractional delay less than one sample). But this is the technique used to tune physical waveguide models.
Try searching the web for "fractional" "waveguide" "allpass" or the like.
Larry Troxler
PD-list mailing list PD-list@iem.at to manage your subscription (including un-subscription) see http://iem.at/cgi-bin/mailman/listinfo/pd-list
On Fri, 14 May 2004, Roman Haefeli wrote:
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument was: it should be possible to set the values of each sample so, that the resulting signal would be similar to a digitized analogue signal with a shorter than 1 sample delay.
Suppose you have a signal at exactly the Nyquist frequency and RMS=sqrt(2). Then its data is like +1,-1,+1,-1,...
Delaying the signal by 0.5 positions, using linear interpolation, yields:
(+1-1)/2,(-1+1)/2,... = 0,0,0,0,... so your signal got mangled down to complete silence.
Delaying the signal by 0.5 positions, using fourier interpolation, goes like: [fft~] finds a single peak, at Nyquist frequency. Then given a turn = 2*pi radians = 2 samples at Nyquist, then a 0.5 sample delay is a pi/2 phase shift to the Nyquist bin, so you do [ifft~] on sqrt(-1)*pi/2 times the Nyquist bin and then it depends on how [ifft~] is implemented.
The big problem is that, at Nyquist freq, if you want to preserve Parseval's identity ("the RMS of the signal = the RMS of its spectrum"), then there are only two possibilities of phase: 0 and pi. All the others inevitably reduce the RMS. So if [ifft~] rounds the phase towards the nearest of two values, you have a delay of either 0 or 1 sample, and if it doesn't round, then it doesn't support Parseval's identity.
Proof: the signal has period of 2 samples. So it alternates between two values, call them A and B. If A+B is nonzero, then the signal has a DC component, but we said it only has a Nyquist component, so B=-A. We supposed RMS=sqrt(2). RMS is computable as A^2+B^2=RMS^2 (Pythagoras' Theorem ;-]) In this case it's also A^2+(-A)^2=sqrt(2)^2, so 2*A^2=2, so A^2=1, so A=+1 or A=-1. so phase is either 0 or pi.
is there anything still unclear?
Mathieu Bouchard http://artengine.ca/matju
On Sunday 16 May 2004 13:25, Mathieu Bouchard wrote:
On Fri, 14 May 2004, Roman Haefeli wrote:
i had a discussion with a teacher today. the topic was the smallest delay-time possible. in his opinion one sample is the atom of signal and cannot be divided anymore. in my opinion it should be possible to get shorter delays than 1 samples with interpolation. my argument was: it should be possible to set the values of each sample so, that the resulting signal would be similar to a digitized analogue signal with a shorter than 1 sample delay.
Suppose you have a signal at exactly the Nyquist frequency and RMS=sqrt(2). Then its data is like +1,-1,+1,-1,...
Isn't that a pathological case though? I thought the Nyquist requirement was SR > Fmax, not SR >= Fmax. I could be wrong A signal at SR/2 is by theory, outside the Nyquist creterion.
is there anything still unclear?
Yes, namely what you are attempting to prove.
Larry Troxer
On Sun, 16 May 2004, Larry Troxler wrote:
Suppose you have a signal at exactly the Nyquist frequency and RMS=sqrt(2). Then its data is like +1,-1,+1,-1,...
Isn't that a pathological case though? I thought the Nyquist requirement was SR > Fmax, not SR >= Fmax.
The Nyquist requirement is for a given frequency to be not representable at all. What I mean is that even before going beyond Nyquist, you hit other problems, such that, even though a frequency is still representable, you have a limited number of allowable phases for it, and that trying to synthesize the "wrong" phases may cause the output to be quiet, silent, or full of interference patterns.
Yes, namely what you are attempting to prove.
That, for even for representable frequencies, one may be unable to shift phase in small enough increments for the delay to be less than one sample. That is, without completely borking the signal or rounding down to no effect at all.
For lower frequencies, that problem may be less apparent, and maybe it would be possible to do it. If I were to do it in practice, I'd use a [fft~] and then do appropriate phase shifts and see experimentally whether it works, but then, I don't know why I'd ever use such small delays... Any idea why subsample delays would be useful?
Mathieu Bouchard http://artengine.ca/matju
Mathieu Bouchard matju@sympatico.ca:
Any idea why subsample delays would be useful?
yeah, the problem is karplus-strong-synthesis. the sound is generated by feedbacks, so the length of the delay determines the frequency. if the grid of possible delay-values is 1 sample, you get very large spaces between the resulting frequencies. (f = srate / delayinsamples). it's not only about smaller than 1 sample, but more precise than a sample. have a look at the beginning of this discussion.
Suppose you have a signal at exactly the Nyquist frequency and RMS=sqrt(2). Then its data is like +1,-1,+1,-1,...
yeah, i see the problem with the phase. but i'm still not sure if it is a problem with lower frequencies than the nyquist-freq. generate a freq that you can still hear (maybe 16kHz). you admit, that it sounds constant although it looks not quite like sine-wave? where ever you start to play it you start with a different phase. so i don't see your argument that you reduces the possible states of phase with high frequencies.
roman
Hallo, Roman Haefeli hat gesagt: // Roman Haefeli wrote:
yeah, the problem is karplus-strong-synthesis. the sound is generated by feedbacks, so the length of the delay determines the frequency. if the grid of possible delay-values is 1 sample, you get very large spaces between the resulting frequencies. (f = srate / delayinsamples). it's not only about smaller than 1 sample, but more precise than a sample. have a look at the beginning of this discussion.
Yes. One problem is the highest possible frequency you can create with Karplus-Strong synthesis.
There you have:
frequency of tone = 1/delay length in seconds
If you create a 1-sample-delay, your delay length is exactly 1/samplerate and freq would become == samplerate, also according to your formula.
But as the sample theorem tells us, you cannot create a signal with a frequency that is larger than SR/2, so to actually make use of a Karplus-Strong delayline, you'd need to make the delay at least 2 samples long.
The other, more interesting problem is, can you and how could you get around the quantization of possible pluck frequencies according to above formula? Do you need to oversample to get delays with fractional samples length? Like when you want to synthesize a pluck with a frequency of 16000 Hz in CD quality, you'd need a delay length of 44100.0 / 16000.0 ~= 2.75 samples. Or is this possible with some kind of interpolation like in a wavetable oscillator or does it require oversampling? I think, it should be possible with interpolation, but I'd have to dig out those DSP books for that or search the music-dsp archive...
Frank Barknecht _ ______footils.org__
On Monday 17 May 2004 07:47 pm, Frank Barknecht wrote:
Hallo,
Roman Haefeli hat gesagt: // Roman Haefeli wrote:
yeah, the problem is karplus-strong-synthesis. the sound is generated by feedbacks, so the length of the delay determines the frequency. if the grid of possible delay-values is 1 sample, you get very large spaces between the resulting frequencies. (f = srate / delayinsamples). it's not only about smaller than 1 sample, but more precise than a sample. have a look at the beginning of this discussion.
Yes. One problem is the highest possible frequency you can create with Karplus-Strong synthesis.
There you have:
frequency of tone = 1/delay length in seconds
If you create a 1-sample-delay, your delay length is exactly 1/samplerate and freq would become == samplerate, also according to your formula.
But as the sample theorem tells us, you cannot create a signal with a frequency that is larger than SR/2, so to actually make use of a Karplus-Strong delayline, you'd need to make the delay at least 2 samples long.
The other, more interesting problem is, can you and how could you get around the quantization of possible pluck frequencies according to above formula? Do you need to oversample to get delays with fractional samples length? Like when you want to synthesize a pluck with a frequency of 16000 Hz in CD quality, you'd need a delay length of 44100.0 / 16000.0 ~= 2.75 samples. Or is this possible with some kind of interpolation like in a wavetable oscillator or does it require oversampling? I think, it should be possible with interpolation, but I'd have to dig out those DSP books for that or search the music-dsp archive...
Ciao
It definitely seems to be possible to get around the quantization using interpolation. Here's a polyphonic stringed instrument I made which uses vd~. It can play any pitch up to midi note 77 (about the maximum with a 44100hz sample rate and blocksize=64).
http://home.gci.net/~pamsaylor/ben/polystr.inst.pd http://home.gci.net/~pamsaylor/ben/polystr.voice.pd http://home.gci.net/~pamsaylor/ben/polystr.string.pd
Ben
Frank Barknecht wrote:
...Like when you want to synthesize a pluck with a frequency of 16000 Hz in CD quality, you'd need a delay length of 44100.0 / 16000.0 ~= 2.75 samples.
Have you noticed how tinny/inaccurate-compared-to-the-real-thing a 16kHz pluck sounds on CD?
Martin
On Monday 17 May 2004 03:18, Mathieu Bouchard wrote:
On Sun, 16 May 2004, Larry Troxler wrote:
Suppose you have a signal at exactly the Nyquist frequency and RMS=sqrt(2). Then its data is like +1,-1,+1,-1,...
Isn't that a pathological case though? I thought the Nyquist requirement was SR > Fmax, not SR >= Fmax.
The Nyquist requirement is for a given frequency to be not representable at all. What I mean is that even before going beyond Nyquist, you hit other problems, such that, even though a frequency is still representable, you have a limited number of allowable phases for it, and that trying to synthesize the "wrong" phases may cause the output to be quiet, silent, or full of interference patterns.
I think we must be talking past each other, sorry. The Nyquist theorem states that a signal bandlimited to some f is _exactly_ recoverable from samples of the signal at a sample rate greater than 2f, provided that the proper bandlimited interpolation is used. There is no issue with "a limitied number of allowable phases". So no, the Nyquist requirement is not for a frequency to be representable at all, it's for a non-time-limited frequency to be represented exactly, phase and all.
Larry Troxler
There is no issue with "a limitied number of allowable phases". So no, the Nyquist requirement is not for a
frequency
to be representable at all, it's for a non-time-limited frequency to be represented exactly, phase and all.
Larry Troxler
nice to get a reliable answer. thank you
roman