coherent WaveBurst
Library Reference Guide
home
cWB_docker
git
cWB
library
tools
stft
tutorials
TestChirp.C
Go to the documentation of this file.
1
//
2
// Display Spetrogram from formula
3
// Author : Gabriele Vedovato
4
5
{
6
7
#define SAMPLERATE 4096
8
9
using namespace
CWB
;
10
11
wavearray<double>
x
;
12
x.
resize
(6*
SAMPLERATE
);
13
x.
rate
(
SAMPLERATE
);
14
x.
start
(0);
15
x=0;
16
x[3*
SAMPLERATE
]=1;
17
18
double
pi
=
TMath::Pi
();
19
double
dt
=1./x.
rate
();
20
//for(int i=0;i<x.size();i++) x[i]=sin(2*pi*200*i*dt);
21
for
(
int
i
=0;
i
<x.
size
();
i
++) x[
i
]=sin(2*pi*100*(
i
*dt)*(
i
*
dt
));
22
23
int
nfact
=4;
24
int
nfft
=nfact*512;
25
int
noverlap
=nfft-10;
26
/*
27
int nfact=1;
28
int nfft=nfact*128;
29
int noverlap=nfft-nfft/4;
30
*/
31
//int noverlap=1;
32
double
fparm
=nfact*6;
33
STFT
stft
(x,nfft,noverlap,
"energy"
,
"gauss"
,fparm);
34
//STFT stft(x,nfft,noverlap,"energy","rectangular",fparm);
35
double
Tmin
=4;
36
double
Tmax
=5;
37
double
Fmin
=800.0;
38
double
Fmax
=1000.0;
39
double
Zmin
=0.0;
40
double
Zmax
=0.0;
41
char
title
[256]=
"rectangular window"
;
42
stft
.
Draw
(Tmin,Tmax,Fmin,Fmax,Zmin,Zmax,1);
43
}
noverlap
int noverlap
Definition:
TestDelta.C:20
CWB
Definition:
ced.hh:42
wavearray::rate
virtual void rate(double r)
Definition:
wavearray.hh:141
wavearray< double >
nfact
int nfact
Definition:
TestDelta.C:18
nfft
int nfft
Definition:
TestDelta.C:19
Fmin
double Fmin
Definition:
TestDelta.C:27
wavearray::start
virtual void start(double s)
Definition:
wavearray.hh:137
dt
double dt
Definition:
TestChirp.C:19
i
i drho i
Definition:
cwb_epparameters.C:88
x
wavearray< double > x
Definition:
TestChirp.C:5
pi
double pi
Definition:
TestChirp.C:18
CWB::STFT::Draw
void Draw(double t1=0.0, double t2=0.0, double f1=0.0, double f2=0.0, double z1=0.0, double z2=0.0, int dpaletteId=DUMMY_PALETTE_ID, Option_t *option="colfz")
Definition:
STFT.cc:94
wavearray::size
virtual size_t size() const
Definition:
wavearray.hh:145
Zmin
double Zmin
Definition:
TestDelta.C:29
Tmax
double Tmax
Definition:
TestDelta.C:26
CWB::STFT
Definition:
STFT.hh:62
Tmin
double Tmin
Definition:
TestDelta.C:25
Pi
double Pi
Definition:
DrawPhaseShift.C:12
Zmax
double Zmax
Definition:
TestDelta.C:30
SAMPLERATE
#define SAMPLERATE
title
char title[256]
Definition:
SSeriesExample.C:1
Fmax
double Fmax
Definition:
TestDelta.C:28
wavearray::resize
virtual void resize(unsigned int)
Definition:
wavearray.cc:463
fparm
double fparm
Definition:
TestDelta.C:22
stft
CWB::STFT * stft
Definition:
ChirpMass.C:121