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

조회 수: 3 (최근 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 CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by