How can I separate these four sensor data from one audio file?
1 view (last 30 days)
Show older comments
Md Shahriar Islam
on 6 Oct 2018
Commented: Star Strider
on 12 Oct 2018
Hi, I have an audio file that has four signals in it. These 4 signals are not of the same size. How can I separate these signals?
0 Comments
Accepted Answer
Star Strider
on 6 Oct 2018
One approach:
D = load('signal.mat');
s = D.new_signal;
x = 1:numel(s);
[seu, sel] = envelope(s, 250, 'rms'); % Calculate Envelope
cpidx = findchangepts(seu, 'MaxNumChanges',3, 'Statistic','linear'); % Find Transitions
figure
plot(x, s)
hold on
plot([cpidx; cpidx], ones(2,numel(cpidx)).*ylim', '-g', 'LineWidth',2)
hold off
grid
axis tight
Out = mat2cell([s; x], 2, diff([0 cpidx numel(s)])); % Cell Array Of The Different Signals
The result is:
Out =
1×4 cell array
{2×6026 double} {2×9632 double} {2×6776 double} {2×7326 double}
The separations are illustrated here:
2 Comments
More Answers (0)
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!