#include <stdio.h>
#include <stdlib.h>
#include "tools.h"
Go to the source code of this file.
◆ fir()
void fir |
( |
size_t |
n, |
|
|
float |
in[n], |
|
|
float |
out[n], |
|
|
float |
kernel[n], |
|
|
size_t |
ksize |
|
) |
| |
Definition at line 5 of file fir.c.
9 for( i = 0; i < n - ksize + 1; ++i )
10 for( j = 0; j < ksize; ++j )
11 out[ i ] += in[ i + j ] * kernel[ j ];
References out.
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 14 of file fir.c.
20 fprintf(stderr,
"Usage: %s size data_file\n", argv[0]);
27 float (*in)[n],(*out)[n],(*kernel)[n];
28 in=
malloc(
sizeof(
float)*n);
29 out=calloc(n,
sizeof(
float));
30 kernel=
malloc(
sizeof(
float)*n);
35 fir(n,*in,*
out,*kernel,n/8);
void fir(size_t n, float in[n], float out[n], float kernel[n], size_t ksize)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
References close_data_file(), fir(), fprintf(), free(), init_data_file(), init_data_float(), malloc(), out, and print_array_float().