DSPRelated.com
Forums

detune a signal

Started by Hans Fugal January 14, 2006
How does one detune a signal? My understanding is that you resample,
but resampling involves changing the duration as well, so after
processing a block you would have a different number of samples than
you started out with. Then what do you do? pad/truncate?

Hans Fugal wrote:
> How does one detune a signal? My understanding is that you resample, > but resampling involves changing the duration as well, so after > processing a block you would have a different number of samples than > you started out with. Then what do you do? pad/truncate?
I don't know what you have in mind. Resampling doesn't necessarily alter duration. I know of tuning only in an analog circuit, although resonance effects exist also in digital filters. Can you provide context? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
More context: this will be an audio processing plugin (VST and DSSI),
and the way plugins work is they take a block of n samples and return a
block of n samples.

> Resampling doesn't necessarily alter duration.
Would you elaborate on that? I thought that resampling a signal did alter its duration.
I think maybe the OP is using the phrase "retune" to mean "change the
frequency of" as in re-tune a musical instrument....

Mark

Mark wrote:
> I think maybe the OP is using the phrase "retune" to mean "change the > frequency of" as in re-tune a musical instrument....
Maybe. What would "detune" mean? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Hans Fugal wrote:
> More context: this will be an audio processing plugin (VST and DSSI), > and the way plugins work is they take a block of n samples and return a > block of n samples. > > >>Resampling doesn't necessarily alter duration. > > > Would you elaborate on that? I thought that resampling a signal did > alter its duration.
A think of resampling a signal as converting if to a new sample rate without altering the duration or frequency content. If course, eliminating any frequencies above half the sample rate is necessary, but that's the only change (if any). When you say resampling, what do you mean? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
I'm sorry my original post was rather vague. I see that now as I read
it again.

I had on my nearsighted glasses and forgot that resample is usually, as
you say, to keep everything the same but just at a different sample
rate. What I want to do is basically to pitch shift the signal. One way
is to resample and play back at the original sample rate, and in that
context the duration does change. e.g. One second at 44100 downsampled
to 22050 and played back at 44100 lasts 1/2 second, and is higher in
pitch. As I plan to detune by only a few cents, it won't be quite so
dramatic as that, but the issue remains.

Somehow I hadn't equated it with pitch shifting before, and my google
searches for detune were rather frustrating. I may have more luck with
that phrase.

Hans Fugal wrote:
> I'm sorry my original post was rather vague. I see that now as I read > it again. > > I had on my nearsighted glasses and forgot that resample is usually, as > you say, to keep everything the same but just at a different sample > rate. What I want to do is basically to pitch shift the signal. One way > is to resample and play back at the original sample rate, and in that > context the duration does change. e.g. One second at 44100 downsampled > to 22050 and played back at 44100 lasts 1/2 second, and is higher in > pitch. As I plan to detune by only a few cents, it won't be quite so > dramatic as that, but the issue remains. > > Somehow I hadn't equated it with pitch shifting before, and my google > searches for detune were rather frustrating. I may have more luck with > that phrase.
Look at http://www.dspdimension.com/ and http://www.mega-nerd.com/SRC/ They will probably fill your need. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������