-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFFTHelper.h
47 lines (37 loc) · 1.19 KB
/
FFTHelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// FFTHelper.h
// OpenSpirometry
//
// Updated for objective-c implementation
//
//* Real FFT wrapper for Apple's Accelerate Framework
//*
//* Created by Parag K. Mital - http://pkmital.com
//* Contact: [email protected]
//*
//* Copyright 2011 Parag K. Mital. All rights reserved.
// Modified by Eric Larson 2013.
// Copyright (c) 2013 Eric Larson. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Accelerate/Accelerate.h>
enum WindowType {
WindowTypeHann,
WindowTypeHamming,
WindowTypeRect,
WindowTypeBlackman,
};
@interface FFTHelper : NSObject
@property (nonatomic,readonly) float *timeSeries; // for getting the invers FFT time series
@property (nonatomic,readonly) size_t fftSize;
@property (nonatomic,readonly) size_t fftSizeOver2;
@property (nonatomic,readonly) size_t windowSize;
- (id)init;
- (id)initWithFFTSize: (int)fftSize;
- (id)initWithFFTSize: (int)fftSize
andWindow:(enum WindowType) winType;
-(void)performForwardFFTWithData:(float*)data;
-(void)copydBMagnitudeToBuffer:(float*)buffer;
-(void)performForwardFFTWithData:(float*)data andCopydBMagnitudeToBuffer:(float*)buffer;
//TODO: check inverse FFT and add to public API
@end