Edit envelope data by mouse

1 view (last 30 days)
Hans Buchele
Hans Buchele on 29 Dec 2022
Commented: Star Strider on 30 Dec 2022
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 Comment
Image Analyst
Image Analyst on 30 Dec 2022
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.

Sign in to comment.

Answers (2)

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

Sign in to comment.


Star Strider
Star Strider on 30 Dec 2022
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 Comments
Hans Buchele
Hans Buchele on 30 Dec 2022
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 on 30 Dec 2022
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')
.

Sign in to comment.

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!