Calc-Funktion weiter, unnötige Funktionen auskommentiert (kompiliert)

This commit is contained in:
Patrick Hangl
2026-02-02 16:12:41 +01:00
parent fa787bec48
commit f6fa0ed021
85 changed files with 16931 additions and 12836 deletions

View File

@@ -23,25 +23,25 @@ static volatile int16_t chess_storage(DMB) *input_pointer_0;
static volatile int16_t chess_storage(DMB) *input_pointer_1;
static volatile int16_t chess_storage(DMB) *output_pointer;
static volatile int16_t chess_storage(DMB) *sample_pointer;
static volatile int16_t chess_storage(DMB) sample; //Speicherplatz für Ergebnis der calc()-Funktion
static volatile int16_t chess_storage(DMB) sample; //Speicherplatz für Ergebnis der calculate_output()-Funktion
int main(void) {
// Biquad Filter für C-Sensor und Acc-Sensor anlegen
// Alle 0 bis auf b[0] -> einfacher Gain auf 0,75
double b0[5]={0.75, 0., 0., 0., 0.};
double b1[5]={0.75, 0., 0., 0., 0.};
// Alle 0 bis auf b[0] -> einfacher Gain auf 0,75 wenn erster Eintrag 0.75, bei Eintrag 1. ist Filter
double b0[5]={1., 0., 0., 0., 0.};
double b1[5]={1., 0., 0., 0., 0.};
int coefficients = MAX_FIR_COEFFS; // 64 Koeffizienten für ANR
// Signale initialisieren: oben angelegte Structs mit Parametern füllen
// Buffer für Delay-Line und Koeffizienten initialisieren
init(
initialize_signal(
&c_sensor_signal_t, &acc_sensor_signal_t, //Signal-Structs
b0, // Biqquad Koeffizienten C-Sensor
b1, // Biqquad Koeffizienten Acc-Sensor
2, // Sample Delay C-Sensor
2, // Sample Delay Acc-Sensor
0.9, //Gewichtung C-Sensor
0.9, //Gewichtung Acc-Sensor
1, //Gewichtung C-Sensor
1, //Gewichtung Acc-Sensor
0.01, // Mu
coefficients // Anzahl Filterkoeffizienten
);
@@ -59,7 +59,7 @@ int main(void) {
input_port[i] = (int16_t) d0;
input_port[i+1] = (int16_t) d1;
}
calc(
calculate_output(
&c_sensor_signal_t, &acc_sensor_signal_t, &input_port[0], &input_port[1], output_port);
for (int i=0; i<BLOCK_LEN; i++){
fprintf(fp3, "%d\n", output_port[i]);