1
$\begingroup$
y[n] = b0x[n] +b1x[n-1]

I have this MA filter in matlab as following

 load handel;
 x = y;

 b0 = 0.5;
 b1 = 0.5;

 N = length(x); % Length of input signal
 y = zeros(size(x)); % Allocate space for outut

 y(1) = b0*x(1); % First sample, assuming x(0) = 0
  for n=2:N % Remaining samples
    y(n) = b0*x(n) + b1*x(n-1);
  end;

 soundsc(y,Fs);

I was asked to listen to the signal and describe it , well I have run the load handel without filter in matlab than i have run the signal with this filter , it sounds like that with filter the signal sounds more demped and less noise compared without filter and when i changed the b1 to b1 =-0.5 it hears only the descant the base of sound is gone . Now I want to know the reason behind.

  1. What is the effect of the filter on the input signal which pass through the system?
  2. what is the effect of the filter on input signal which pass through the system if we change b0= 0.5 and b1 = -0.5?
$\endgroup$
  • $\begingroup$ well, 1. it's a moving average! 2. it's the opposite of a moving average! I'm sure you've had your own considerations so far, and we won't be giving you a complete introduction to discrete system theory as answer. Can you please narrow down your question? Run the thing, plot the signals, compare, explain what you did and did not expect. (PS: Homework questions, and this looks extremely much like one, are OK, but you really need to explain what you've considered so far) $\endgroup$ – Marcus Müller Mar 23 '19 at 10:24
  • $\begingroup$ I was asked to listen to the signal and describe it , well I have run the load handel without filter in matlab than i have run the signal with this filter , it sounds like that the signal sounds more demped and less noise and when i changed the b1 to b1 =-0.5 i hear only the discant the base of sound is gone . Now I want to know the reason behind $\endgroup$ – Adam Mar 23 '19 at 10:47
  • $\begingroup$ very nice! Should be part of your question! so, what are your thoughts on these phenomena? Please edit your question to include the info you just gave in your comment, and your thoughts. $\endgroup$ – Marcus Müller Mar 23 '19 at 12:07
1
$\begingroup$

1.) The moving average filter works as a low pass filter. Consequently, it will attenuate the high-frequency part of the signal and passes the low-frequency part of the signal. Therefore, the output signal should sound flat.

2.) If we change b0= 0.5 and b1 = -0.5, the filter works basically as a differentiator, subtracting one sample from another sample. In this case, the filter works as a high pass filter, attenuating the low-frequency part of the signal. Therefore, when listening to the output signal, the high-frequency part of the input signal should appear amplified.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.