How to create an envelope on a specific signal

4 ビュー (過去 30 日間)
maryam
maryam 2015 年 1 月 29 日
コメント済み: Scott MacKenzie 2021 年 7 月 9 日
could anybody please guide me how i can find the lower & upper envelope on a signal? would you give me a simple example?thank you

採用された回答

Star Strider
Star Strider 2015 年 1 月 29 日
Use the hilbert function:
t = linspace(0,5*pi,1000);
s = sin(t) .* cos(15*t);
hs = hilbert(s);
figure(1)
plot(t, s)
plot(t,-abs(hs),'r-', t,abs(hs),'-r', 'LineWidth',1.5)
hold off
grid
produces:
  6 件のコメント
Saeed Haidar
Saeed Haidar 2020 年 7 月 23 日
hello guys,
can someone help me create an envelope to my signal, here's the code:
fs = 44100;
c5=key(52,8,fs);
a4=key(49,8,fs);
b4=key(51,8,fs);
e4=key(44,8,fs);
e5=key(56,8,fs);
d5=key(54,8,fs);
f5=key(57,8,fs);
line1= [ e4 a4 b4 c5 a4 ];
line2= [ e4 a4 b4 c5 a4 ];
line3= [ e4 a4 b4 c5 b4 a4 c5 b4 a4 e5 e5 e5 d5 e5 f5 f5];
song=[line1 line2 line3];
sound(song,fs,24);
function wave= key(p,n,fs)
t=0:1/fs:4/n;
idx=440*2^((p-49)/12);
tt=4/n:1/fs:0;
wave=(sin(2*pi*idx*t)).*exp(tt);
wave=wave./max(wave);
end
Scott MacKenzie
Scott MacKenzie 2021 年 7 月 9 日
@Saeed Haidar. You comment is about something quite different -- adding an envelope (attack, sustain, decay) to the notes in a melody. If you are still interested in this, please post as a separate question.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by