<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="id9042921">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Modeling guitar distortion in Matlab</name>
<metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">1.1</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2006/12/18 02:38:39.993 US/Central</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2006/12/20 16:21:06.660 US/Central</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="brent">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Brent</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">E.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Stephens</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">brents@rice.edu</md:email>
    </md:author>
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="narayann">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Neil</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">K.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Narayan</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">narayann@rice.edu</md:email>
    </md:author>
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="robsmith">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Rob</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Smith</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">rob@rice.edu</md:email>
    </md:author>
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="barron">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Barron</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Stone</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">barron@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="brent">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Brent</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">E.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Stephens</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">brents@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="narayann">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Neil</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">K.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Narayan</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">narayann@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="robsmith">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Rob</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Smith</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">rob@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="barron">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Barron</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Stone</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">barron@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">distortion</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">guitar</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">matlab</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">An implementation of distortion in Matlab</md:abstract>
</metadata>
<content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="id8993349">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.</para>
<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="element-550"><name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Distorted Sine Wave</name>
  <media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="clippedsine.png"/>
  <caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">A picture of a sine wave after it has been processed with the Matlab function below</caption></figure><figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="element-316"><name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">FFT of a distorted sine wave</name>
  <media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="fftafterdistortion.png"/></figure><para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="element-862">The Matlab code that implements this algorithm is also very simple:</para><code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="block">function [output]=fuzzy(sound, amount)

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

for i = 1:length(output)
    
  
  if ( output(i) &gt; amount )
    output(i) = amount;
  end

  if ( output(i) &lt; -amount)
     output(i) = -amount;
  end
 
end
 
output = output*norms;</code>












</content>
</document>

