InterpolateShannon.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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) override;
  48. int transposeStereo(SAMPLETYPE *dest,
  49. const SAMPLETYPE *src,
  50. int &srcSamples) override;
  51. int transposeMulti(SAMPLETYPE *dest,
  52. const SAMPLETYPE *src,
  53. int &srcSamples) override;
  54. double fract;
  55. public:
  56. InterpolateShannon();
  57. void resetRegisters() override;
  58. virtual int getLatency() const override
  59. {
  60. return 3;
  61. }
  62. };
  63. }
  64. #endif