Spectrum_extensions.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _Spectrum_extensions_h_
  2. #define _Spectrum_extensions_h_
  3. /* Spectrum_extensions.h
  4. *
  5. * Copyright (C) 1993-2011, 2015 David Weenink
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /*
  21. djmw 20010114
  22. djmw 20020813 GPL header
  23. djmw 20121022 Latest modification
  24. */
  25. #include "Spectrum.h"
  26. #include "Sound.h"
  27. #include "Graphics.h"
  28. autoSpectrum Spectrum_resample (Spectrum me, integer numberOfFrequencies);
  29. autoSpectrum Spectrum_compressFrequencyDomain (Spectrum me, double fmax, integer interpolationDepth, int freqscale, int method);
  30. autoSpectrum Spectrum_shiftFrequencies (Spectrum me, double shiftBy, double newMaximumFrequency, integer interpolationDepth);
  31. // Shift will be plusminus dx/2
  32. autoMatrix Spectrum_unwrap (Spectrum me);
  33. /*
  34. Unwrap the phases of the spectrum according to an algorithm by
  35. Tribolet as published in:
  36. Tribolet, J.M. & Quatieri, T.F. (1979), Computation of the Complex
  37. Spectrum, in: Programs for Digital Signal Processing,
  38. Digital Signal Processing Commitee (eds), IEEE Press,
  39. chapter 7.1.
  40. First row of returned matrix contains the amplitudes-squared,
  41. second row contains the unwrapped phases.
  42. */
  43. void Spectrum_drawPhases (Spectrum me, Graphics g, double fmin, double fmax,
  44. double phase_min, double phase_max, int unwrap, int garnish);
  45. autoSpectrum Spectra_multiply (Spectrum me, Spectrum thee);
  46. void Spectrum_conjugate (Spectrum me);
  47. #endif /* _Spectrum_extensions_h_ */