0

ギター用のディストーション ペダルを作成しており、ハイパス フィルターを使用してディストーションを作成しました。ノートがフェードアウトし始めるときにこのパチパチというノイズが聞こえることを除いて、すべてが本当にうまく機能します.

function audio = reaper(frame, drive, tone)
    % Distortion pedal with high-pass filter and gain.
    %
    %   audio = reaper(frame, drive, tone)
    %
    %   frame: audio frame to be processed (int32)
    %   drive: amount of gain to apply to the filtered signal (between 0 and 10)
    %   tone: cuttoff frequency for high-pass filter (between 0 and 10)
    %
    %   The reaper distortion pedal first sends the signal through a
    %   butterworth filter (high-pass) that sets the cutoff frequency based
    %   on the tone. Then the filtered frequency is multiplied by the drive
    %   (gain). The resulting audio frequency is returned.

    % Use butterworth filter for high-pass filter
    [zeros,poles,gain] = butter(1,265*((tone+(10/9))*(9/10))/(44100/2),'high'); % Tone is normalized between 1 and 10
    [num,den] = zp2tf(zeros,poles,gain);
    
    % Apply high-pass filter with gain
    audio = int32(((drive+(10/99))*(99/10))*filter(num,den,double(frame))); % Drive is normalized between 1 and 100
end

4

0 に答える 0