Edit envelope data by mouse

1 次查看(过去 30 天)
Hans Buchele
Hans Buchele 2022-12-29
评论: Star Strider 2022-12-30
Dear community,
I am working with big signal envelopes and would like to be able to edit a printed envelope by mouse (drawing parts of the envelope new) which should replace the old data.
x = audioread('1.wav'); % read audiofile
q = hilbert(x); % create envelopes
env = abs(q);
za = env(:,1);
zb = env(:,2);
plot(za); % plot first envelope
Unfortunately I was not able to get any further!
Envelope 1 = original envelope
Envelope 2 = example 1 of modified envelope
Envelope 3 = example 2 of modified envelope
Any help is much appreciated! Thank you!
  1 个评论
Image Analyst
Image Analyst 2022-12-30
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Screenshots also help explain your situation.

请先登录,再进行评论。

回答(2 个)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022-12-29
Have you read this DOC? envelope()
WHat about this DOC2? hilbert()
  1 个评论
Hans Buchele
Hans Buchele 2022-12-29
Thank you for the links! I have read both docs before but my problem goes beyond these topics.

请先登录,再进行评论。


Star Strider
Star Strider 2022-12-30
Please describe what you want to do.
If envelope is not doing what you want, and you want to find the peaks (rather than RMS or other envelope options), one option may be findpeaks. It may be possible to edit what findpeaks returns.
  2 个评论
Hans Buchele
Hans Buchele 2022-12-30
Thanks for your help Star Strider!
I want to open/plot the original signal envelope and be able to 'redraw' some parts of it. The redraw should create new data points which are safed in the original envelope data. Later I would like to apply the modified envelope to an audio file.
Star Strider
Star Strider 2022-12-30
I am not certain that this is possible to do interactively. If you know the sort of envelope function you want for the signal, it would be relatively straightforward to apply it, providing that the variation (frequency) in the modulating (envelope) function is sufficiently different from the signal frequency.
Example —
Fs = 1000;
L = 5;
t = linspace(0, 100*L, Fs*L)/Fs;
s1 = sin(2*pi*100*t);
s2 = cos(2*pi*5*t);
s12 = s1.*s2;
[eh,el] = envelope(s12, 5, 'peak');
figure
subplot(3,1,1)
plot(t, s1)
grid
title('s1')
subplot(3,1,2)
plot(t, s2)
grid
title('s2')
subplot(3,1,3)
plot(t, s12)
hold on
plot(t, [eh; el], 'r')
hold off
grid
title('s12')
xlabel('t')
.

请先登录,再进行评论。

标签

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by