home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / audio / 3193 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  3.9 KB

  1. Path: sparky!uunet!mcsun!uknet!jet!djs
  2. From: djs@jet.uk (David J Stevenson)
  3. Newsgroups: comp.sys.amiga.audio
  4. Subject: Re: Halving sample speed while keeping pitch
  5. Message-ID: <1992Aug26.145436.5222@jet.uk>
  6. Date: 26 Aug 92 14:54:36 GMT
  7. References: <9208241809.AA00474@.nairobi.inel.gov.inel.gov.> <ERICJ.92Aug24131911@lagos.cfsat.Honeywell.COM>
  8. Organization: Joint European Torus
  9. Lines: 68
  10.  
  11. In <ERICJ.92Aug24131911@lagos.cfsat.Honeywell.COM> ericj@hwcae.Honeywell.COM (Eric Jacobsen) writes:
  12.  
  13. >In article <9208241809.AA00474@.nairobi.inel.gov.inel.gov.> mnu@INEL.GOV (Rick Morneau) writes:
  14.  
  15. >   I don't want to change the sampling rate - I want to slow down the  
  16. >   signal without changing the pitch of the human voice (in case you're  
  17. >   wondering, I'm working with speech, NOT music). In other words, I  
  18. >   want to stretch out the signal so that it sounds like the speaker is  
  19. >   speaking more slowly, with out distorting the pitch.
  20.  
  21. >Oh! NOW I understand! It sure sounded like you were asking for a method
  22. >of downsampling. My apologies for the confusion on my part.
  23.  
  24. >What you are asking for is possible, but not trivial to accomplish
  25. >and not the sort of thing I'd expect to see in most canned software.
  26.  
  27. >One way to get what you are looking for:
  28.  
  29. >1. Upsample the signal until it is of the length you wish. The pitch
  30. >will be lower, but you can get the time duration you want.
  31.  
  32. >2. Take the upsampled signal and mix it with a sine wave that shifts
  33. >the pitch back up. (You get a sum and difference frequency, you filter
  34. >out the difference freq). Actually, this is kinda tough to do 
  35. >digitally. It is a lot easier to do this in the analog domain when
  36. >you play it back.
  37. Eh?  What pitch sine wave? At what level?
  38. What the software actually needs to do is double the number of samples
  39. in the signal; this is what oversampling does.  So, between every sample
  40. in the source signal add a sample at the zero level (may be zero, or 32768
  41. or whatever, depending on number of bits and whether the signal data is
  42. signed).  This gives the correct number of samples, but has introduced some
  43. high-frequency distortion.
  44.  
  45. However, this distortion is ABOVE the maximum frequency present in the
  46. original signal (see Nyquist theorem).  It can therefore be removed by a
  47. simple filter.  How to design digital filters is a complex subject to
  48. understand, but the algorithms for designing filters are available in the
  49. public domain.  Search the comp.dsp FAQ for references on filter design.  If
  50. the signal sample rate is fixed, you only need design the filter once, and
  51. can do so with as many (or few) parameters as your run-time routines can
  52. handle.
  53.  
  54. Example:  You have a signal sampled at 25kHz for 4 seconds.  Add the zeros,
  55. giving you 200k samples in total.  The highest frequency in the original
  56. signal is (in theory; in practise it may actually be lower) 12.5kHz.  Apply
  57. a digital filter to remove frequencies above this.  Your zeros will now
  58. be an interpolation between the 'real' values from the original signal.
  59.  
  60. Notes:  If the signal is going to be output through some fairly low quality
  61.         device, it may be sufficient to simplify this by inserting, between
  62.         each real sample, a new sample which is half-way between the samples
  63.         either side.  This is, conceptually, the same as following the above
  64.         scheme, but with a simple, lowish-quality, digital filter stage.
  65.  
  66.         Digital filters are easier to implement on specialist DSPs; I am not
  67.         an Amiga person, so I do not know if such processors are available
  68.         as add-ins.  The NeXT and Atari Falcon machines have DSPs built in.
  69.  
  70. Hope this helps, and I suggest you find an FAQ for comp.dsp, if there is
  71. one.
  72.  
  73. -- 
  74. +---------------------------------------------------+
  75. | David Stevenson  djs@jet.uk   Tel: +44 235 465028 |
  76. +---------------------------------------------------+
  77. - Disclaimer: Please note that the above is a personal view and should not 
  78.   be construed as an official comment from the JET project.
  79.