Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
true_peak_dsp.h
1
/*
2
* SPDX-FileCopyrightText: © 2020 Alexandros Theodotou <alex@zrythm.org>
3
*
4
* SPDX-License-Identifier: LicenseRef-ZrythmLicense
5
*
6
* This file incorporates work covered by the following copyright and
7
* permission notice:
8
*
9
* Copyright (C) 2013 Robin Gareus <robin@gareus.org>
10
*
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2, or (at your option)
14
* any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, write to the Free Software Foundation,
23
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
*/
25
26
#ifndef __AUDIO_TRUE_PEAK_DSP__
27
#define __AUDIO_TRUE_PEAK_DSP__
28
29
#include "ext/zita-resampler/resampler.h"
30
31
typedef
struct
TruePeakDsp
32
{
33
float
m;
34
float
p;
35
float
z1;
36
float
z2;
37
bool
res;
38
float
* buf;
39
ZitaResampler * src;
40
41
float
w1;
// attack filter coefficient
42
float
w2;
// attack filter coefficient
43
float
w3;
// release filter coefficient
44
float
g;
// gain factor
45
}
TruePeakDsp
;
46
53
void
54
true_peak_dsp_process (
TruePeakDsp
* self,
float
* p,
int
n);
55
56
void
57
true_peak_dsp_process_max (
TruePeakDsp
* self,
float
* p,
int
n);
58
59
float
60
true_peak_dsp_read_f (
TruePeakDsp
* self);
61
62
void
63
true_peak_dsp_read (
TruePeakDsp
* self,
float
* m,
float
* p);
64
65
void
66
true_peak_dsp_reset (
TruePeakDsp
* self);
67
71
void
72
true_peak_dsp_init (
TruePeakDsp
* self,
float
samplerate);
73
74
TruePeakDsp
*
75
true_peak_dsp_new (
void
);
76
77
void
78
true_peak_dsp_free (
TruePeakDsp
* self);
79
80
#endif
TruePeakDsp
Definition
true_peak_dsp.h:32
dsp
true_peak_dsp.h
Generated by
1.11.0