Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Modeling guitar distortion in Matlab

A very simple type of guitar distortion can be done with clipping of the signal. This is where a threshold value is set, and if the signal ever increases above this value, it is clipped off. This type of distortion adds a "fuzzy" sounding distortion. As is obvious from the picture of the frequency-domain effects of clipping, clipping the signal creates a more complex signal by adding more frequencies.

The Matlab code that implements this algorithm is also very simple:

function [output]=fuzzy(sound, amount)

norms = norm(sound);
output = sound/norms;
amount = (1- amount)/100;

for i = 1:length(output)


if ( output(i) > amount )
output(i) = amount;
end

if ( output(i) < -amount)
output(i) = -amount;
end

end

output = output*norms;

1 comments:

drew92 said...

Here's another very simple algorithm, but this one gives a more "analog" sounding distortion, like overdriven tubes. It works by repeatedly taking the sine of the signal which "squashes" the wave (high-amplitude samples get attenuated more than low-amplitude samples):


function output = distortion(input,amount)

% distorts input signal to simulate sound of overdriven vacuum tubes
% distortion amount can be any positive integer
% values of 75-100 give a good continuum of light to heavy distortion


% repeatedly take the sine of the input to distort the waveform

for k=1:amount
input= sin(input);
end

% normalize maximum amplitude to 1 to prevent clipping

output= input/norm(input);

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.