Thanks for the response, Maybe I can ask a question which is sort of related to SRC as u mention its sort of derived from Julius O. Smith's work... In his paper on Bandlimited Interpolation on his site he states "Since the original signal is always assumed to be bandlimited to half the sampling rate, (otherwise aliasing distortion would occur upon sampling), Shannon's sampling theorem tells us the signal can be exactly and uniquely reconstructed for all time from its samples by bandlimited interpolation" Does this mean that the signal is assumed to be bandlimited BEFORE it is filtered by SRC or does this mean it is assumed that the filter SRC uses itself WILL produce a bandlimited result? Tks Rob Erik de Castro Lopo <nospam@mega-nerd.com> wrote in message news:<3F380EE2.B5F79556@mega-nerd.com>...> Rob Edgar wrote: > > > > Hi there, > > First be gentle! I know very little about this stuff :-) > > I have been asked to develop a module to emulate whatever SoundForge > > does to downsample a speech only wav file from 44.1khz to 11.025khz > > and 8khz when it has the "apply anti-alias filter" set. > > Well this is a wheel that you may not need to re-invent. > > Have a look at Secret Rabbit Code: > > http://mega-nerd.com/SRC/ > > It works on *nix, Mac and Win32 and is released under the > GNU GPL. A license for use with closed source software can > also be obtained at a reasonable rate. > > Erik
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →
downsampling
Started by ●August 11, 2003
Reply by ●August 12, 20032003-08-12
Reply by ●August 12, 20032003-08-12
Rob Edgar wrote:> > Does this mean that the signal is assumed to be bandlimited BEFORE it > is filtered by SRC or does this mean it is assumed that the filter SRC > uses itself WILL produce a bandlimited result?The signal has to be bandlimited before it is sampled. SRC generally assumes that it is not, and so it applies a filter before resampling. But if the signal is ALREADY limited to < 4KHz, and you sample it at 48KHz, you can just throw away 5 out of 6 samples without filtering. If it is NOT already bandlimited, you have to filter it (i.e., bandlimit it) before discarding samples. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (703) 779-7770 There's a fine line between clever and stupid
Reply by ●August 12, 20032003-08-12
robedgar@hkstar.com (Rob Edgar) wrote in message news:<3560d674.0308112323.1887a0f9@posting.google.com>...> Jerry, > Thanks... > > > > I guess what I am getting at here is is there >>any<< diff in the > > > final resultant between > > > 1) record at 44 / filter to remove freqs>4 / downsample to 8 > > > and > > > 2) record at 8 / filter to remove freqs>4 > > ><big snip> If you are using a normal sound card to do the recording, then the input signal will automatically be filtered at a suitable cutoff, thus there is normally no benefit to doing the recording at the higher rate unless you wish to use it at the higher rate. Once the sampling has taken place it is IMPOSSIBLE* to filter out frequencies that were higher than half the sampling rate. Regards Robert * unless you know what they were, and even then it may be a problem.
Reply by ●August 12, 20032003-08-12
Thanks Clay, Sounds like a similar story :-)... Well I know about 200% more than I did yesterday and have managed to basically get it all figured with thanks to the various tips I have recieved.... Rob "Clay S. Turner" <physicsNOOOOSPPPPAMMMM@bellsouth.net> wrote in message news:<5M5_a.4208$rh1.3103@fe04.atl2.webusenet.com>...> "Rob Edgar" <robedgar@hkstar.com> wrote in message > news:3560d674.0308112323.1887a0f9@posting.google.com... > > other stuff snipped. > > > > > > Anyway I am insterested in knowing is there any point in recording > > someone speaking at 44.1khz when I intend only to downsample to 8khz > > taking as a given that I will at some point have filtered for >4khz > > freqs i.e does the first procedure produce a better end product... > > > > Hello Rob, > > Sometimes sound cards don't appropriately scale their input antialias filter > with changes in the sampling rate. Once when I had that problem with a > studio making voice prompts. (I didn't get to choose the studio - a person > there was related to a person I worked for at the time) I had them record > them at 44.1kHz sampling rate and 16 bits per sample. I then did the scaling > and sample rate conversion to make them work for a telephone voice mail > system. > > It was also a good opportunity to write sample rate conversion code. In > going from 44100 to 8000, I ended up using a cascade of 4 > interpolator-decimators. Once the "c" structure for one was worked out, it > was a simple matter to have four of them. > > Clay
Reply by ●August 12, 20032003-08-12
robedgar@hkstar.com (Rob Edgar) writes:>Anyway I am insterested in knowing is there any point in recording >someone speaking at 44.1khz when I intend only to downsample to 8khz >taking as a given that I will at some point have filtered for >4khz >freqs i.e does the first procedure produce a better end product...It depends on the filter ahead of the A/D converter. If, when you set the sound card (or other digitizer) to 8 kHz sampling, you get a high-quality filter that blocks everything at 4 kHz and above, it's OK to digitize at 8 kHz in the first place. On the other hand, a cheap sound card is likely *not* to have a good analog filter matched to each of the sampling rates it provides. So you're probably better off sampling at the highest frequency and bit depth available, and downsampling digitally. Then *you* get to control the quality of the 4 kHz lowpass filter.>I think the answer is YES, becuase if your speach, say, contained >freqs that were up to 6khz when orginally recorded then, its would be >impossible to accurately filter them out of an 8khz file but easy to >filter out of a 44khz file, due to the nyquist theory the echo(if >thats the right word) of 0-6 would run 8>2 in an 8khz file so it would >already be intermingled with the original signal and impossible to >accurately remove whereas in the 44k file it runs 38-44 and so can be >removed precisely.The real problem is aliasing. If the input contains 6 kHz signals, and the analog lowpass filter doesn't remove them, then the process of digitizing at 8 kHz will convert the 6 kHz signals to *2 kHz*. You'll actually be able to hear a signal at 2 kHz which did not really exist, and there's no way to get rid of it after sampling (without also removing any *real* 2 kHz content). Dave
Reply by ●August 13, 20032003-08-13
Rob Edgar wrote:> > Thanks Clay, > > Sounds like a similar story :-)... > > Well I know about 200% more than I did yesterday and have managed to > basically get it all figured with thanks to the various tips I have > recieved.... > > Rob... 200% is probably enough, but I'll try to spell it out a little in a little more detail and add a few facts. Telephone audio is sampled at 8 Ksps as far as I know. That's enough for good intelligibility, but higher, around 12, is marginally more intelligible and noticeably more natural. 11.025 is a good choice for a system whose spec includes the CD rate, 44.1. 8 (for telephony) or 12 Ksps would be natural for a system capable of 48 0r 96. If you want to end up with 11.025, you can filter the analog signal appropriately (no components over 5 KHz) and sample at that rate directly. If you have adequate computing resources and there is a suitable filter for 44.1 sampling but none for 11.025, sampling at 44.1 and decimating (with filtering) is a no-added-cost way to accomplish the same thing. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●August 14, 20032003-08-14
"Dave Martindale" <davem@cs.ubc.ca> wrote in message news:bhbqdu$hpf$2@mughi.cs.ubc.ca...> robedgar@hkstar.com (Rob Edgar) writes: > > >Anyway I am insterested in knowing is there any point in recording > >someone speaking at 44.1khz when I intend only to downsample to 8khz > >taking as a given that I will at some point have filtered for >4khz > >freqs i.e does the first procedure produce a better end product... > > It depends on the filter ahead of the A/D converter. If, when you set > the sound card (or other digitizer) to 8 kHz sampling, you get a > high-quality filter that blocks everything at 4 kHz and above, it's OK > to digitize at 8 kHz in the first place. On the other hand, a cheap > sound card is likely *not* to have a good analog filter matched to each > of the sampling rates it provides. So you're probably better off > sampling at the highest frequency and bit depth available, and > downsampling digitally. Then *you* get to control the quality of the > 4 kHz lowpass filter.This would be relatively easy to test if you have a test tone generator*. Just put a high-volume test tone in the 5-10k range into your sound card and record what you get with an 8kHz sample rate. If you get almost nothing, then the filter is a good one. If you get a significant level of some other frequency, it's not so good. You could then compare this to sampling at 44.1 and doing your own downsampling. *or you could record test tones generated by your sound card to tape or CD and play back.
Reply by ●September 7, 20062006-09-07
>"Dave Martindale" <davem@cs.ubc.ca> wrote in message >news:bhbqdu$hpf$2@mughi.cs.ubc.ca... >> robedgar@hkstar.com (Rob Edgar) writes: >> >> >Anyway I am insterested in knowing is there any point in recording >> >someone speaking at 44.1khz when I intend only to downsample to 8khz >> >taking as a given that I will at some point have filtered for >4khz >> >freqs i.e does the first procedure produce a better end product... >> >> It depends on the filter ahead of the A/D converter. If, when you set >> the sound card (or other digitizer) to 8 kHz sampling, you get a >> high-quality filter that blocks everything at 4 kHz and above, it's OK >> to digitize at 8 kHz in the first place. On the other hand, a cheap >> sound card is likely *not* to have a good analog filter matched toeach>> of the sampling rates it provides. So you're probably better off >> sampling at the highest frequency and bit depth available, and >> downsampling digitally. Then *you* get to control the quality of the >> 4 kHz lowpass filter. > >This would be relatively easy to test if you have a test tonegenerator*.>Just put a high-volume test tone in the 5-10k range into your sound cardand>record what you get with an 8kHz sample rate. If you get almostnothing,>then the filter is a good one. If you get a significant level of someother>frequency, it's not so good. You could then compare this to sampling at >44.1 and doing your own downsampling. > >*or you could record test tones generated by your sound card to tape orCD>and play back. > > >I am doing similar thing to vibration signals. The original signal I got was sampled at 45K Hz, now I want to look at 100Hz signal at time domain. I have already got filter coefficients. what shall I do next? (1) Low pass filter the signal? Is there any straight forward C code for this part. (2) pick up the nth sample of the filtered signal to get the downsampled signal? Thanks
Reply by ●September 8, 20062006-09-08
helen wrote:> I am doing similar thing to vibration signals. The original signal I got > was sampled at 45K Hz, now I want to look at 100Hz signal at time domain. > I have already got filter coefficients. what shall I do next? (1) Low pass > filter the signal? Is there any straight forward C code for this part. (2) > pick up the nth sample of the filtered signal to get the downsampled > signal? ThanksHi again Helen, I have almost the same answer to your other post: http://www.dspguru.com/info/faqs/mrfaq.htm -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 There's a fine line between clever and stupid







