![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197172/image.png)
How can I separate these four sensor data from one audio file?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2018년 10월 6일
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197172/image.png)
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!