-
Notifications
You must be signed in to change notification settings - Fork 1
/
fp_if.m
29 lines (25 loc) · 794 Bytes
/
fp_if.m
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
% LISTING PROGRAM of INSTANTANEOUS FREKUQUENCY
% CALCULATE SPECTROGRAM AND INSTANTANEOUS FREQUENCY
% FINAL PROJECT BY BAGUS TRIS ATMAJA - 2405 100 019
% TITLE : MACHINE SOUNDS SEPARATION USING INDEPENDEN COMPONENT ANALYSIS
% FROM MICROPHONE ARRAY FOR FAULT DETECTION
% LISTING ADAPTED FROM http://labrosa.ee.columbia.edu
% -------------------------------------------------------------------------
% close all
% clear all
% clc
%r=11025;
%d=bearing
[d,r]=wavread('x11.wav');
[I,S]=ifgram(d,256,256,128,r);
[R,M]=extractrax(abs(S));
a=size(R);
F=colinterpvals(R,I);
P=-colinterpvals(R,unwrap(angle(S)));
size(F);
tt=[1:a(2)]*128/r; % default spectogram step is NFFT/2 i.e 128
size(tt);
specgram(d,256,r); ylim([0 5000]);
hold on;
figure;
plot(tt,F','r'); ylim([0 5000]);