-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunDemo.m
66 lines (40 loc) · 1.09 KB
/
runDemo.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
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
% Show a demo of the noise analysis and synthesis
%
% Author : J.-A. Adrian (JA) <jens-alrik.adrian AT jade-hs.de>
% Date : 25-Feb-2016 17:43:32
clear;
close all;
szFilename = 'CHACE.Smpl.1_Noise.wav';
[vSignal,fs] = audioread(szFilename);
%% Full analysis and synthesis.
% Create object and consider clicks.
obj = NoiseSynthesis.NoiseAnalysisSynthesis(vSignal,fs);
obj.ModelParameters.bApplyClicks = true;
% Show infos during analysis and synthesis
obj.bVerbose = true;
% Call analysis and synthesize a two-channel signal.
obj.analyze();
obj.synthesize();
% Listen to results.
obj.sound();
% Plot results.
obj.plot();
% Retrieve the sensor signals.
mSignalMatrix = obj.SensorSignals;
% or
% mSignalMatrix = obj.synthesize();
pause;
%% Don't analyze but load a preset
clear;
close all;
fs = 44.1e3;
noiseType = 'optical';
obj = NoiseSynthesis.NoiseAnalysisSynthesis();
obj.Fs = fs;
obj.readParameters(fullfile('+NoiseSynthesis', noiseType));
obj.DesiredSignalLenSamples = round(5 * fs);
obj.synthesize();
mSignalMatrix = obj.SensorSignals;
obj.sound();
obj.plot();
% End of file: runDemo.m