• API Main Page
  • Documentation
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

src/time_frequency.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Matthias Ihrke   *
00003  *   mihrke@uni-goettingen.de   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00033 #ifndef TIME_FREQUENCY_H
00034 # define TIME_FREQUENCY_H
00035 
00036 #include "definitions.h"
00037 #include "complex.h"
00038 #include "array.h"
00039 #include "optarg.h"
00040 #include <math.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00051   typedef Array* (*WindowFunction)(int,double);
00052 
00055   typedef struct {
00056     int            N_freq;       
00057     int            N_time;  
00058      double         samplingrate; 
00059      double         low_corner_freq; 
00060      double         up_corner_freq; 
00061      Complex        **sgram; 
00062   } Spectrogram;
00063   
00064   Spectrogram* spectrogram_stft(const Array* sig, double sampling_rate,
00065                                           const Array *Window, int N_freq, int N_time, 
00066                                           double corner_freqs[2], 
00067                                           int *timepoints, Spectrogram *spectgram);
00068   Spectrogram* spectrogram( const Array *sig, Spectrogram *spectgram, 
00069                                      OptArgList *optargs );
00070   Array* spectrogram_powerspectrum( const Spectrogram *spect );
00071 
00072   Spectrogram* spectrogram_init( int N_freq, int N_time );
00073   void         spectrogram_free( Spectrogram *s );
00074 
00075 
00076   /*------------------- window functions --------------- */
00077   Array* window_dirichlet( int n, double noparam );
00078   Array* window_gaussian ( int n, double sigma );
00079   Array* window_hamming  ( int n, double noparam );
00080   Array* window_hanning  ( int n, double noparam );
00081   Array* window_kaiser   ( int n, double alpha );
00082 
00083 #ifdef __cplusplus
00084 }
00085 #endif
00086 
00087 
00088 
00089 #endif /* TIME_FREQUENCY_H */

Generated on Fri Jun 25 2010 14:10:21 for libeegtools by  doxygen 1.7.0