Make you own guitar effects using GNURadio Companion
The gnuradio guitar effect machine setup. The guitar belongs to my son, who's six years old. |
How does the distortion effect work? The basic principle is quite simple. A signal is distorted if the response between input and output is not linear. A simplified model of an overdriven amplifier is the following: signal is amplified linearly up to a certain threshold amplitude. Beyond this amplitude, the signal is limited to a threshold voltage. In python, this would be modeled using the following function:
def comp(self,x): return(n.sign(x)*n.minimum(n.abs(self.a*x),self.b))
Overdriven clipping amplifier model. |
import numpy as n
import scipy.interpolate as sint
from gnuradio import gr
import matplotlib.pyplot as plt
class compress(gr.sync_block):
def comp(self,x):
return(n.sign(x)*n.minimum(n.abs(self.a*x),self.b))
def __init__(self, a, b):
self.a=a # gain
self.b=b # clip level
gr.sync_block.__init__(self,
name="compress",
in_sig=[n.float32],
out_sig=[n.float32])
def work(self, input_items, output_items):
in0 = input_items[0]
out = output_items[0]
# compress signal using spline function self.comp
# limit output amplitude to 0.5
out[:]=self.comp(in0)
return len(output_items[0])
GNURadio Companion based guitar effect, spectrum analyzer, and scope flowgraph. |
Guitar effect in action. A demonstration of a sinusoidal signal being filtered into a rectangular waveform. |
Here's an audio clip with output from gnuradio to demonstrate what the output of the filter sounds like. Initially, the signal is clean, and then the distortion is turned on. Disclaimer: I don't know how to play the guitar very well and the guitar was way out of tune.
nice
ReplyDeleteThe Makala is extraordinary for supreme fledglings as it's a moderate brand. Makala Ukuleles are additionally extraordinary for kids as they can come in pastel shades with dolphins on.
ReplyDeletebest ukulele brands
The fact that you are reading this article right now means you are currently unsatisfied with how much money you are earning as a guitar teacher (or you are ready to take things to the next level). read this article
ReplyDeleteThis is superb in light of the fact that it gives you all out authority over the craftsmanship heading your bundling takes. This is an expressive method to bring the character of the craftsman, bandsongs
ReplyDelete