Spectrum_and_Spectrogram.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Spectrum_and_Spectrogram.h
  2. *
  3. * Copyright (C) 1992-2011,2015 David Weenink & Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "Spectrum.h"
  19. #include "Spectrogram.h"
  20. autoSpectrum Spectrogram_to_Spectrum (Spectrogram me, double time);
  21. /*
  22. Function:
  23. Create a time slice from the Spectrogram at the time nearest to 'time'.
  24. Postconditions:
  25. result -> xmin == my ymin; // Lowest frequency; often 0.
  26. result -> xmax == my ymax; // Highest frequency.
  27. result -> nx == my ny; // Number of frequency bands.
  28. result -> dx == my dy; // Frequency step.
  29. result -> x1 == my y1; // Centre of first frequency band.
  30. for (iy = 1; iy <= my ny; iy ++) {
  31. result -> z [1] [i] == sqrt (my z [i] ['time']);
  32. result -> z [2] [i] == 0.0;
  33. }
  34. */
  35. autoSpectrogram Spectrum_to_Spectrogram (Spectrum me);
  36. /*
  37. Function:
  38. Create a Spectrogram with one time slice from the Spectrum.
  39. Postconditions:
  40. thy xmin = 0.0; thy ymin == my xmin;
  41. thy xmax = 1.0; thy ymax == my xmax;
  42. thy nx == 1; thy ny == my nx;
  43. thy dx == 1.0; thy dy == my dx;
  44. thy x1 == 0.5; thy y1 == my x1;
  45. for (i = 1; i <= my nx; i ++)
  46. thy z [i] [1] == (my z [1] [i]) ^ 2 + (my z [2] [i]) ^ 2;
  47. */
  48. /* End of file Spectrum_and_Spectrogram.h */