-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvelopeExtraction.m
More file actions
68 lines (60 loc) · 1.5 KB
/
Copy pathenvelopeExtraction.m
File metadata and controls
68 lines (60 loc) · 1.5 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Titus John
% May 11, 2019
% This function takes the filtered signal and gives out the the diffrent
% envolopes of matching length.
function [hilbertEnv] = envelopeExtraction(filteredSignal, Fs)
% %% Homomorphic
% lpf_frequency = 80;
% homomorphicEnv = Homomorphic_Envelope_with_Hilbert(filteredSignal, Fs,lpf_frequency);
%
%% Hilbert
hilbertEnv = abs(hilbert(filteredSignal));
% %% Wavelet
% win_time = 40/1000; % sec
% overlap_per = 0.5;
% time_interval = win_time * overlap_per; % sec
% window = round(Fs*win_time);
% noverlap = round(window*overlap_per);
%
% [s,w,t] = spectrogram(filteredSignal,window,noverlap,Fs/2,Fs,'yaxis');
%
%
%
% bandPower = [];
% bandEnergy = [];
% fh = 25;
% fl = 0;
%
% for k = 1:length(s(1,:))
%
% rawBand = s(:,k);
% Ex = norm(rawBand,2)^2; % the energy
%
% Px = (1/(fh-fl))* 1/numel(rawBand)*norm(rawBand,2)^2; % power
% bandPower(k)= Px;
% bandEnergy(k)= Ex;
% end
%
%
% WaveEnv = bandPower;
%
% %% PSD
% N = length(filteredSignal);
% filteredSignal_dft = fft(filteredSignal);
% PSDEnv= (1/(2*pi*N)) * abs(filteredSignal_dft).^2;
%
% %% Plot the results
% figure
% subplot(4,1,1)
% plot(filteredSignal)
% title('Raw Signal')
% subplot(4,1,2)
% plot(hilbertEnv)
% title('Hilbert')
% subplot(4,1,3)
% plot(WaveEnv)
% title('WaveEnv')
% subplot(4,1,4)
% plot(PSDEnv)
% title('PSDEnv')
end