Need help with filters and Karplus-Strong algorithm (guitar strings)

2 ビュー (過去 30 日間)
claudio
claudio 2016 年 3 月 14 日
Hello everybody! Firstly, I am having some trouble to understand the filters used in the code below...I have to play a music note as described below. Secondly, I need to play a sequence of music notes separately and later all together.
Any help will be apreciated.
fs=44100;
A=150;
F=linspace(1/fs, 1000, 2^12);
x=zeros(fs*10, 1);
delay=round(fs/A);
b=firls(42, [0 1/delay 2/delay 1], [0 0 1 1]);
a=[1 zeros(1, delay) -0.5 -0.5];
[H,W]=freqz(b, a, F, fs);
zi=rand(max(length(b), length(a))-1,1);
note=filter(b, a, x, zi);
note=note-mean(note);
note=note/max(abs(note));
hplayer=audioplayer(note, fs);
play(hplayer);
hplayer;

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio Processing Algorithm Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by