-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathTest_Poly_Chrip.m
More file actions
31 lines (28 loc) · 819 Bytes
/
Copy pathTest_Poly_Chrip.m
File metadata and controls
31 lines (28 loc) · 819 Bytes
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
% This function test Fast Polynomial chriplet analysis
clear all
close all
addpath('./util')
addpath('./Polynomial_chriplet_analysis')
Fs = 200;
t = 0 : 1/Fs : 15;
c1 = 2 * pi * 10; % initial frequency of the chirp excitation
c2 = 2 * pi * 5/2; % set the speed of frequency change be 1 Hz/second
c3 = 2 * pi * 1/3;
c4 = 2 * pi * -1/40;
Sig = sin(c1 * t + c2 * t.^2 / 2 + c3 * t.^3 /3 + c4 * t.^4 /4); % get the A(t)
n1 = rand(size(Sig));
n1 = n1 - mean(n1);
n1 = 3*n1 / max(n1) * max(Sig);
std(n1)
Sig = Sig + n1/2;
y = Sig';
Hop_Size = 1;
Nfft = 512;
alpha = 0;
Iter = 7;
win = MakeWindows('Gaussian' , 215);
[specgm , f , p] = Do_PCT( Iter , t, y , win , Hop_Size , Nfft , Fs , alpha);
figure
plot(t, f, t, p)
figure
DisplaySTFT(specgm , Fs , Hop_Size , 0,50)