annotate dsp/signalconditioning/Framer.h @ 73:dcb555b90924

* Key detector: when returning key strengths, use the peak value of the three underlying chromagram correlations (from 36-bin chromagram) corresponding to each key, instead of the mean. Rationale: This is the same method as used when returning the key value, and it's nice to have the same results in both returned value and plot. The peak performed better than the sum with a simple test set of triads, so it seems reasonable to change the plot to match the key output rather than the other way around. * FFT: kiss_fftr returns only the non-conjugate bins, synthesise the rest rather than leaving them (perhaps dangerously) undefined. Fixes an uninitialised data error in chromagram that could cause garbage results from key detector. * Constant Q: remove precalculated values again, I reckon they're not proving such a good tradeoff.
author cannam
date Fri, 05 Jun 2009 15:12:39 +0000
parents d7116e3183f8
children e5907ae6de17
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2
cannam@0 3 /*
cannam@0 4 QM DSP Library
cannam@0 5
cannam@0 6 Centre for Digital Music, Queen Mary, University of London.
cannam@0 7 This file copyright 2005-2006 Christian Landone.
cannam@0 8 All rights reserved.
cannam@0 9 */
cannam@0 10
cannam@0 11 #ifndef FRAMER_H
cannam@0 12 #define FRAMER_H
cannam@0 13
cannam@0 14 //#include <io.h>
cannam@0 15 #include <fcntl.h>
cannam@0 16 #include <stdio.h>
cannam@0 17
cannam@0 18
cannam@0 19 class Framer
cannam@0 20 {
cannam@0 21 public:
cannam@0 22 void setSource( double* src, unsigned int length );
cannam@0 23 unsigned int getMaxNoFrames();
cannam@0 24 void getFrame( double* dst );
cannam@0 25 void configure( unsigned int frameLength, unsigned int hop );
cannam@0 26 Framer();
cannam@0 27 virtual ~Framer();
cannam@0 28
cannam@0 29 void resetCounters();
cannam@0 30
cannam@0 31 private:
cannam@0 32
cannam@0 33 unsigned long m_ulSampleLen; // DataLength (samples)
cannam@0 34 unsigned int m_framesRead; // Read Frames Index
cannam@0 35
cannam@0 36 double* m_srcBuffer;
cannam@0 37 double* m_dataFrame; // Analysis Frame Buffer
cannam@0 38 double* m_strideFrame; // Stride Frame Buffer
cannam@0 39 unsigned int m_frameLength; // Analysis Frame Length
cannam@0 40 unsigned int m_stepSize; // Analysis Frame Stride
cannam@0 41
cannam@0 42 unsigned int m_maxFrames;
cannam@0 43
cannam@0 44 unsigned long m_ulSrcIndex;
cannam@0 45 };
cannam@0 46
cannam@0 47 #endif