-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsavwin.c
executable file
·41 lines (36 loc) · 1.53 KB
/
savwin.c
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
/***************************************************************************
license.c - shows license information
-------------------
begin : Mon Dec 1 20:26:00 CET 2003
copyright : (C) 2002 by Gwyndaf Evans
email : gwyndaf@gwyndafevans.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "chooch.h"
void savwin(double fEres, double fEdge, double dE, int *nSavWin) {
double fMonoRes;
extern int verbose;
fMonoRes = fEres * fEdge;
*nSavWin = (int) (fMonoRes / dE);
if(*nSavWin > 29){
*nSavWin=29;
}
if(*nSavWin < 2){
*nSavWin=2;
}
if(verbose>0)printf("dE = %f Resol = %f\n", dE, fMonoRes);
if(verbose>0)printf("Savitsky-Golay window value = %d\n", *nSavWin);
}