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')
.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by