InterpolateShannon.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///
  3. /// Sample interpolation routine using 8-tap band-limited Shannon interpolation
  4. /// with kaiser window.
  5. ///
  6. /// Notice. This algorithm is remarkably much heavier than linear or cubic
  7. /// interpolation, and not remarkably better than cubic algorithm. Thus mostly
  8. /// for experimental purposes
  9. ///
  10. /// Author : Copyright (c) Olli Parviainen
  11. /// Author e-mail : oparviai 'at' iki.fi
  12. /// SoundTouch WWW: http://www.surina.net/soundtouch
  13. ///
  14. ////////////////////////////////////////////////////////////////////////////////
  15. //
  16. // License :
  17. //
  18. // SoundTouch audio processing library
  19. // Copyright (c) Olli Parviainen
  20. //
  21. // This library is free software; you can redistribute it and/or
  22. // modify it under the terms of the GNU Lesser General Public
  23. // License as published by the Free Software Foundation; either
  24. // version 2.1 of the License, or (at your option) any later version.
  25. //
  26. // This library is distributed in the hope that it will be useful,
  27. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  29. // Lesser General Public License for more details.
  30. //
  31. // You should have received a copy of the GNU Lesser General Public
  32. // License along with this library; if not, write to the Free Software
  33. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  34. //
  35. ////////////////////////////////////////////////////////////////////////////////
  36. #ifndef _InterpolateShannon_H_
  37. #define _InterpolateShannon_H_
  38. #include "RateTransposer.h"
  39. #include "STTypes.h"
  40. namespace soundtouch
  41. {
  42. class InterpolateShannon : public TransposerBase
  43. {
  44. protected:
  45. int transposeMono(SAMPLETYPE *dest,
  46. const SAMPLETYPE *src,
  47. int &srcSamples);
  48. int transposeStereo(SAMPLETYPE *dest,
  49. const SAMPLETYPE *src,
  50. int &srcSamples);
  51. int transposeMulti(SAMPLETYPE *dest,
  52. const SAMPLETYPE *src,
  53. int &srcSamples);
  54. double fract;
  55. public:
  56. InterpolateShannon();
  57. void resetRegisters();
  58. int getLatency() const
  59. {
  60. return 3;
  61. }
  62. };
  63. }
  64. #endif