1. Consider the audio system in a car. Some people like to hear a lot of bass. Give an equation, in your
preference of time or frequency domain, for a bass boost.
2. Write a MATLAB or Octave program that, given a sequence, f[k], of samples in the time domain,
calculates a filtered output y[k], given by the formula y[k]=-a_2[k-1]-a_1y[k-2]-a_0y[k-3]+b_3f[k]+b_2f[k-
1]+b_1f[k-2]+b_0f[k-3].
The values y are outputs, k is an index into a sequence, (so if "now"=k, one
sample in the past is k-1), there are coefficient vectors a and b, which can be input parameters to the
function. Make up a sequence
f. Plot the input f and that output, y.
3. Run your program with all of the a coefficients set to 0. Plot the input and output
The answer
1. Bass Boost Equation (Frequency Domain)
To boost bass (low frequencies), a common approach is to use a shelving filter. The frequency domain equation for a simple bass boost filter is:
Where:
-
is the frequency response
-
is the boost gain factor
-
is the cutoff frequency
-
is the frequency variable
Alternatively, in the time domain, a simple bass boost filter can be achieved with a difference equation such as:
Where (typically positive, e.g., 0.5) sets the amount of bass boost.
2. MATLAB Program for a General 3rd-Order Filter
We’ll create a function to compute output y[k] using your provided difference equation, and test it with a made-up sequence:
MATLAB/Octave Code:
Result Discussion:
-
With nonzero a
coefficients:
The output y will show the effect of feedback, possibly smoothing or coloring the input.
-
With a = [0 0 0]
:
The output becomes a moving weighted sum of current and previous 3 input values (no feedback). The result is a linear filter (FIR), and the output follows the input with smoothing according to the b coefficients.
You can copy and run this code in MATLAB or Octave.
It will plot both the input and output sequences for both cases, clearly showing the effect of feedback coefficients.
📩 Need a similar solution? Email me: adel455@hotmail.com