-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPeakFinder.h
37 lines (26 loc) · 1007 Bytes
/
PeakFinder.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
//
// PeakFinder.h
// OpenSpirometry
//
// Created by Eric Larson
// Copyright (c) 2015 Eric Larson. All rights reserved.
//
#import <Foundation/Foundation.h>
// helper class for the analysis (used like a struct, but allows ARC and Obj-C objects)
@interface Peak : NSObject
@property (nonatomic) NSUInteger index;
@property (nonatomic) float frequency;
@property (strong, nonatomic) NSMutableArray *harmonics;
@property (nonatomic) NSUInteger multiple;
@property (nonatomic) float magnitude;
@end
@interface PeakFinder : NSObject
-(id)initWithFrequencyResolution:(float)res;
-(NSArray*)getFundamentalPeaksFromBuffer:(float *)magBuffer
withLength:(NSUInteger)length
usingWindowSize:(NSUInteger)windowSize
andPeakMagnitudeMinimum:(float)peakMagnitude
aboveFrequency:(float)minimumFrequency;
- (float)getFrequencyFromIndex:(NSUInteger)index
usingData:(float*)data;
@end