Article View: comp.dsp
Article #1937Re: 48k to 44.1k sample rate conversion
From: Michael Vargo
Date: Thu, 16 May 1991 05:29
Date: Thu, 16 May 1991 05:29
43 lines
2119 bytes
2119 bytes
I have been following this thread, and it seems the approaches are quite
elegant, but maybe a little bit complicated.
1. If there really is significant energy in the 22,500 to 24,000Hz band,
then a low pass filter will be required to prevent aliasing on the
downsample. Maybe this signal is dog whistles so something will be needed.
It seems a simple FIR filter could be applied to the 48kHz sampled data to
wipe this out. I have an Excel spreadsheet to calculate coefs if your
interested. But, I wouldn't bother. Of course, I play guitar. :-)
2. An interpolation can be done using a function similar to the following.
I wrote this to downsample Mac sounds before converting them to mu-law PCM
at 8kHz.
int crush(x,y,ix,iy)
unsigned char *x,*y;
int ix,iy;
{
/* This function will take ix samples and crush them into iy samples. */
/* This can be used to down sample a data stream to a lower date rate. */
int i,ipoint;
int delta;
for ( i=0 ; i<iy ; i++ )
{
ipoint = (i*ix)/iy;
delta = x[ipoint+1] - x[ipoint];
delta = (delta*((i*ix)-(ipoint*iy)))/iy;
y[i] = x[ipoint] + delta;
}
}
In this case, the samples are only a byte wide. You could go crazy and use
double floats. This function used to do that but it was quite slow. It
seems my Mac IIsi is missing the math co-processor!
Now my question:
Does the act of interpolation actually do some sort of low pass filtering?
I think not but maybe it could be looked at as some sort of averaging?
Technical Details
Message-ID:
<1991May16.052920.21060@netcom.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!netcomsv!mfvargoReferences:
<5826@media-lab.media.mit.edu.MEDIA.MIT.EDU> <1991May13.173129.18295@bernina.ethz.ch> <1991May15.105543.12165@bernina.ethz.ch>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!netcomsv!mfvargo
From: mfvargo@netcom.COM (Michael Vargo)
Newsgroups: comp.dsp
Subject: Re: 48k to 44.1k sample rate conversion
Message-ID: <1991May16.052920.21060@netcom.COM>
Date: 16 May 91 05:29:20 GMT
References: <5826@media-lab.media.mit.edu.MEDIA.MIT.EDU> <1991May13.173129.18295@bernina.ethz.ch> <1991May15.105543.12165@bernina.ethz.ch>
Sender: netnews@netcom.COM (USENET Administration)
Organization: Netcom - Online Communication Services UNIX System {408 241-9760 guest}
Lines: 43