% 作成した信号に対し周波数を推定

T = 0.001;
A = 2.0;
f = 5.01;
d = pi/6;
alpha = 1.2;

% 信号を作成

tend = 100;
time = (0:T:tend)';
signal =  sinusoidal_with_noise ( time, A, f, d, alpha, 0 );
plot(time,signal);

% 周波数を推定

estimate_frequency = @(f) estimate_amplitude_phase ( time, signal, f );
freq = fminbnd (estimate_frequency, 4.6, 5.4);
freq
