
Home  Forums  Rules  Articles  diyAudio Store  Gallery  Wiki  Blogs  Register  Donations  FAQ  Calendar  Search  Today's Posts  Mark Forums Read  Search 
Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc. 

Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving 

Thread Tools  Search this Thread 
14th July 2008, 08:52 PM  #1 
diyAudio Member
Join Date: Apr 2004
Location: CA

Digital filtering(upsampling) of complex sine signals (music)
Do you think zero stuffing followed by low pass filtering (and that too 2 or 3 times in a row), no matter how good and precise the filter is, is capable of faithfully following the original shape of a complex sine signal, like music, that is rich in harmonic content ?
For one lonesome sine wave/tone yes I agree that it works great and the charts on the datasheets look great too, but what about music ? Knowing what little I know about digital filtering I am just not able to accept the fact that this twostep process called upsampling(again, done 23 times over) can really be applied to music signals. Maybe its just in my mind. Maybe its just a difficult concept to understand (atleast to my mind) and its just a misconception that I have, but in any case, can anyone please help clear it up for me (preferably with charts and data to back it up) as to whether upsampling works for music signals or not. Thoughts anyone ? 
14th July 2008, 10:35 PM  #2 
diyAudio Member
Join Date: Mar 2006
Location: Switzerland

Of course it works. It is immaterial if the signal is music or speech or noise or anything else, as long as it is properly bandlimited to less than half the sampling frequency. Any college course on signal theory teaches this and there are countless textbooks. I can understand however, that these concepts may be somewhat difficult to understand for those who have never been exposed to the basics.
Although the theory is flawless, the practical implementation is not trivial. A CDplayer implementation will only approximate what needs to be done to recover the audio signal from the CD. How close this approaches the ideal, depends on cost and available technology. The technology is still progressing and only now are we starting to really exploit the full quality of a good mastered CD. Oversampling and upsampling are signal processing steps that convert the signal to higher sampling rates for easier filtering. Properly done (e.g. with high enough arithmetic precision) they are not affecting the original content of the signal, again be it sine waves, music or whatsoever. However, they make the process of postfiltering much easier. If you go through this forum, you may find several threads that deal with these issues. 
14th July 2008, 10:44 PM  #3  
diyAudio Member
Join Date: Aug 2002
Location: Cascais

Re: Digital filtering(upsampling) of complex sine signals (music)
Quote:
Not if you understand the difference between "complex sine" and "lonesome sine" 

15th July 2008, 12:40 AM  #4 
diyAudio Member
Join Date: Apr 2004
Location: CA

here's a typicaly frequency spectrum of a couple of piano keys 
I am sure other musical instruments have the same kind of freq spectra. now lets say a stream of 44.1Khz digital data of this spectrum is sent thru a digital filter to upsample it to 352.8Khz(8x), then are you saying the spectrum of the resulting digital data stream would be exactly same ? and I dont mean by extreme DSP using a filter that costs $10000 with 10000 taps, but just those chips accessible to the common man that do 8x using 169+24+17 taps. 
15th July 2008, 02:23 AM  #5 
diyAudio Member
Join Date: Apr 2004
Location: CA

in case those pics dont show up go to http://www.kettering.edu/~drussell/Piano/Dynamics.html and click on the images.

15th July 2008, 04:50 AM  #6 
diyAudio Member
Join Date: Nov 2007

Fourier showed that just about any function can be decomposed into a bunch of sine functions.
You accept that a single frequency sine wave can go through a filter, no problem. Consider the case of two sine waves. How about three? Now think of lots and lots of sines going through all at the same time. This is the beauty of superposition in a linear system. 
15th July 2008, 05:48 AM  #7 
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California

Javin5 hit the nail on the head.
Yes, it is possible to achieve the performance you cite with the technology specified. I am doing similar things on a $400 dev kit. I test my filters by passing MLS, a pseudorandom noise that has every frequency in it and it passes quite faithfully. Now, whether manufacturer 'X's implementation achieves the performance is a different question all together. 
15th July 2008, 11:19 AM  #8 
diyAudio Member
Join Date: Nov 2007

Upsampling is just a interpolation. According to sampling theorem an ideal interpolation result is obtained by replacing each sample by a SINC function. This is just what convolution with long sinc shaped FIR does.
If in some implementation 8x upsampling is done using 169+24+17 taps, they probable have been using special halfband FIR filters, which have all even coefficients zero value. Drawback of this is a very small passband ripple. 
17th July 2008, 10:46 PM  #9 
diyAudio Member
Join Date: Apr 2004
Location: CA

ok I seem to be coming to terms with the 'complex/multiple' sines but here's really where my mentalblock is about this  (hear me out, please).
To better ask my question let's take two examples of 10 seconds worth of audio data  One is repetitive signal (say a multiple tone sine) , and the other is something nonrepetitive  like real music. If I understand correctly how digital a LPF works, then the newly calculated value of the sample at the output of the filter depends on some 'M' number of samples ahead of that sample. So if M=100 then the new value of sample#1 depends on the values of sample#1 thru sample#100. Now in the repetitive signal, no matter how many samples you take(50 or 500) the batch of samples will always have the same frequency content. Think of this as an FFT on those samples. you will always get the same fft spectrum whether you run the fft against 50 or 500 samples. In the music signal however, I would imagine that the frequency content between say sample# 1 to 500 could be very different from the freq content of the same samples but now broken up into two batches of 1 to 250 and then 250 to 500. I mean the music content between sample# 1 to 250 could be very different from sample# 250 to 500. Thinking in terms of FFT again, you could get a very different spectrum from samples 1 to 250 v/s samples 250 to 500. So wouldn't using 500 samples to derive the value of the one sample give a wrong result, or atleast a result that deviates from the most accurate result ? I realize that the rolloff of the filter depends directly on M, so too few a samples and you compromise the rolloff, too many samples and you might influence the value of the output sample by a sample that is too far away! If thats true then how would you determine what is the optimum number of samples to send as input to the filter ? There doesn't seem to be any clear direction on that. That's where I am stuck. Maybe I am not thinking this through correctly, if so I just need help to clear this up in my mind. 
17th July 2008, 11:42 PM  #10  
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California

Quote:
Another factor is timefrequency duality. A small number of samples (a small time window) doesn't contain any information about low frequencies so it's hard to manipulate low frequencies with a short filter. 1Hz at 44100S/s isn't really defined until you have 44100 samples (1 cycle). This reappears in FFTs where you need a long record length to resolve the frequencies into small bins  a 44100 sample FFT would resolve to 1Hz bins. Quote:


Thread Tools  Search this Thread 


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Digital active filtering using PC  manu27  Digital Line Level  3  27th August 2010 02:19 PM 
Pricenoobject design for dynamic/complex music ?  FlorianO  MultiWay  81  23rd January 2009 01:03 AM 
CDROM Digital Signals  glt  Digital Source  0  2nd December 2008 08:16 AM 
Combining digital Coax Signals  Darkeyce  Digital Source  2  14th February 2006 07:29 AM 
New To Site?  Need Help? 