summaryrefslogtreecommitdiff
path: root/Core/Inc/Effects/retain.h
blob: 47004936ac20fb3b0db9c6dd9d577eba02c98631 (plain)
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
/*
 * retain.h
 *
 *  Created on: Aug 23, 2026
 *      Author: ozpv
 */

#ifndef INC_EFFECTS_RETAIN_H_
#define INC_EFFECTS_RETAIN_H_

#include <stddef.h>
#include <stdint.h>
#include "cs4272.h"

/* must be a power of two
   higher values give better frequency resolution
   and must be paired with a higher BUFFER_SIZE */
#define WINDOW_SIZE 4096
/* change based on necessary overlap */
#define HOP_SIZE (WINDOW_SIZE / 4)
#define OVERLAP_SIZE (WINDOW_SIZE - HOP_SIZE)
#define NUM_OVERLAPS (WINDOW_SIZE / HOP_SIZE)
#define COMPLEX_BIN_COUNT (WINDOW_SIZE / 2 - 1)

void retain_init(void);
void retain(
    const int32_t *samples_in,
    int32_t *samples_out,
    const size_t range_min,
    const size_t range_max,
    const enum Channel channel
);

#endif /* INC_EFFECTS_RETAIN_H_ */