qm-dsp 1.8
Framer.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3/*
4 QM DSP Library
5
6 Centre for Digital Music, Queen Mary, University of London.
7 This file 2005-2006 Christian Landone.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14*/
15
16#ifndef FRAMER_H
17#define FRAMER_H
18
19//#include <io.h>
20#include <fcntl.h>
21#include <stdio.h>
22
23
24class Framer
25{
26public:
27 void setSource( double* src, unsigned int length );
28 unsigned int getMaxNoFrames();
29 void getFrame( double* dst );
30 void configure( unsigned int frameLength, unsigned int hop );
31 Framer();
32 virtual ~Framer();
33
34 void resetCounters();
35
36private:
37
38 unsigned long m_ulSampleLen; // DataLength (samples)
39 unsigned int m_framesRead; // Read Frames Index
40
41 double* m_srcBuffer;
42 double* m_dataFrame; // Analysis Frame Buffer
43 double* m_strideFrame; // Stride Frame Buffer
44 unsigned int m_frameLength; // Analysis Frame Length
45 unsigned int m_stepSize; // Analysis Frame Stride
46
47 unsigned int m_maxFrames;
48
49 unsigned long m_ulSrcIndex;
50};
51
52#endif
unsigned long m_ulSampleLen
Definition Framer.h:38
unsigned int m_maxFrames
Definition Framer.h:47
void resetCounters()
Definition Framer.cpp:92
double * m_dataFrame
Definition Framer.h:42
unsigned int m_stepSize
Definition Framer.h:45
void configure(unsigned int frameLength, unsigned int hop)
Definition Framer.cpp:38
void getFrame(double *dst)
Definition Framer.cpp:60
void setSource(double *src, unsigned int length)
Definition Framer.cpp:103
double * m_srcBuffer
Definition Framer.h:41
virtual ~Framer()
Definition Framer.cpp:29
double * m_strideFrame
Definition Framer.h:43
unsigned long m_ulSrcIndex
Definition Framer.h:49
unsigned int m_framesRead
Definition Framer.h:39
unsigned int getMaxNoFrames()
Definition Framer.cpp:98
Framer()
Definition Framer.cpp:23
unsigned int m_frameLength
Definition Framer.h:44