forked from bartolsthoorn/NVDSP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NVDSP.h
50 lines (34 loc) · 1.21 KB
/
NVDSP.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
48
49
50
//
// NVDSP.h
// NVDSP
//
// Created by Bart Olsthoorn on 13/05/2012.
// Copyright (c) 2012 Bart Olsthoorn
// MIT licensed, see license.txt
//
#import <Foundation/Foundation.h>
#import <Accelerate/Accelerate.h>
@interface NVDSP : NSObject {
float zero, one;
float samplingRate;
float *gInputKeepBuffer[2];
float *gOutputKeepBuffer[2];
float omega, omegaS, omegaC, alpha;
float coefficients[5];
float a0, a1, a2, b0, b1, b2;
}
- (id) initWithSamplingRate:(float)sr;
#pragma mark - Setters
- (void) setCoefficients;
#pragma mark - Effects
- (void) filterContiguousData: (float *)data numFrames:(UInt32)numFrames channel:(UInt32)channel;
- (void) filterData:(float *)data numFrames:(UInt32)numFrames numChannels:(UInt32)numChannels;
- (void) applyGain:(float *)data length:(vDSP_Length)length gain:(float)gain;
#pragma mark - Etc
- (void) intermediateVariables: (float)Fc Q: (float)Q;
- (void) deinterleave: (float *)data left: (float*) left right: (float*) right length: (vDSP_Length)length;
- (void) interleave: (float *)data left: (float*) left right: (float*) right length: (vDSP_Length)length;
#pragma mark - Debug
- (void) logCoefficients;
- (void) stabilityWarning;
@end