Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am stuck on this. Help is much appreciated. We want study a reverberation syst

ID: 2988940 • Letter: I

Question

I am stuck on this. Help is much appreciated.

We want study a reverberation system to duplicate a sound of a particular room or concert hall. This is a more art than a science. We try to make different round-trip delays in the combs. A low pass filter is suggested in the delay loop [1] as shown in Fig. 1. The one-pole low pass filter parameter g depends on the sampling rate, delay loop length, humidity, temperature, and pressure. The purpose of this is to consider the fact that the absorption of sound depends on frequency, with higher frequencies being absorbed more. Six combs followed by an all-pass filter as the reverberation system is proposed in [I J. This reverb system structure is shown in Fig. 2. The all-pass filter transfer function is given in (1). This allpass filter mixes up the phases of the output signals of the combs without change the magnitude of the signals. We have many choices to make the structure: loop delays L, gain constant /?, pole position g of the six combs, and the direct wave factor K. Note: Speed of sound: 345 m/sec, a round trip echo = 20 m, round trip Time: 58 ms Allpass Filter Transfer function; H(z) = K1 z-m +a/1+az-m Suggested parameters in simulation: Sampling frequency: fs = 22.05 kHz Delay time for the six low-pass combs: 50, 56, 61, 68, 72, and 78 msec One-pole low pass filter parameter g: 0.24,, 0.26, 0.28, 0.29, 0.30, 0.32 Direct wave factor K=0.9. All pass filter a=0.7, delay = 6 msec, K, =0.17 Gain constant for each comb /?= 0.83*(l-g) . Run simulation by using MATLAB. You should provide MATLAB code and plots Impulse response of the overall systems (vcctor length = 22050) Magnitude response of each comb filler. Y-axis: -20 to 25 dB, X-axis: Frequency (0 to fs/2 Hz) Magnitude response of the overall systems. Y-axis: -30 to 15 dB, X-axis. Frequency (0 to fs/2 Hz) Suppose the input is a sinusoidal signal with frequency * 1000 Hz (vector length 22050), plot the magnitude response of the output signal (FFT length .V 22050) Y-axis -30 to 50 dH. X-axis Frequency (0 to fs Hz) Phase plot of all-pass filter, Y-axis: rad (-pi to pi). X-axis: Frequency (0 to fs HZ)

Explanation / Answer

h = get(0,'Children'); % get handle of current plots
set(h,'color',[1 1 1]); % set background of plot to white

% test tone generation
fs = 44100; % sampling frequency of test tone in Hz
time = (0:1/fs:1);% 1 sec. time duration of sine wave, T = 1/44100Hz

%--------
% impulse
%--------

imp = zeros(44100,1);
imp(1) = 1;
% f0 = 3500 is used for the AP filter f0
% (assumed to be most sensitive by the Fletcher-Munson curves)

%-------------------
% 70Hz sawtooth wave
%-------------------

%st70 = sawtooth(2*pi*70*time); % 70Hz sawtooth wave
%st70 = 0.35.*st70;
% reduce amplitude so that filtered signal
% is not clipped beyond -1, +1

%---------------------
% 3.5kHz sawtooth wave
%---------------------

%st3500 = sawtooth(2*pi*3500*time); % 3.5kHz sawtooth wave
%st3500 = 0.6.*st3500;
% reduce amplitude so that filtered signal
% is not clipped beyond -1, +1

%--------------------
% 10kHz sawtooth wave
%--------------------

%st10000 = sawtooth(2*pi*10000*time); % 10kHz sawtooth wave
%st10000 = 0.6.*st10000;
% reduce amplitude so that filtered signal
% is not clipped beyond -1, +1

% note: need to use f0=12100Hz for AP filter formulation
% since approximation has larger frequency errors at higher frequencies

% note: tmax approximation for 10kHz sawtooth waveform
% fails, therefore,
% for tmax = 0.001 mS, use tmax = 0.000285
% for tmax = 0.002 mS, use tmax = 0.000575
% for tmax = 0.004 mS, use tmax = 0.00115
% for tmax = 0.008 mS, use tmax = 0.00235

%----------------------------------------------------
% University of Miami Percussion Ensemble
% use f0 ~ 150Hz for APF formulation since spectogram
% has significant frequency content in this area
%----------------------------------------------------

%perc = wavread('perc.wav');
%perc = 0.8.*perc;
% reduce amplitude so that filtered signal
% is not clipped beyond -1, +1

%----------------------------------------------------
% M-Pact (Jazz vocal group)
% use f0 ~ 160Hz for APF formulation since spectogram
% has significant frequency content in this area
%----------------------------------------------------

%mpact = wavread('mpact.wav');

%--------------------
% test tone selection
%--------------------

x = imp; % select signal from above to be used

% !! check f0 of APF to make sure it corresponds to above signal !!

%------------------------------------------------------------
% Sampling frequency for 2nd-order allpass filter formulation
%------------------------------------------------------------

fs = 44100; % sampling frequency in Hz
T = 1/44100; % sampling period in seconds

%--------------------------
% Allpass filter parameters
%--------------------------

tmax = 0.004 % peak delay in mS of AP
f0 = 3500; % resonant frequency in Hz of AP

%---------------------------
% Allpass filter formulation
%---------------------------

Q = 0.5*tmax*pi*f0 % Q of AP transfer function
w0 = 2*pi*f0; % resonant frequency in radians
sn = 1/w0; % normalized frequency sn
numAP = [sn^2 -sn/Q 1]; % numerator of allpass filter
denAP = [sn^2 +sn/Q 1]; % denominator of allpass filter

f = (0:20:22050); % frequency vector, to 1/2 Nyquist
w = 2*pi*f; % frequency vector in radians
H = freqs(numAP,denAP,w); % complex frequency response
magH = 20*log10(abs(H));% magnitude of H

phaserad = angle(H); % phase of complex frequency response (rad.)
phasedeg = phaserad*180/pi; % convert to degrees
gd = -diff(unwrap(phaserad))./diff(w); % calculate group delay

%---------------------------------
% Analog to Digital Transformation
%---------------------------------

[numAPd,denAPd] = BILINEAR(numAP,denAP,fs);%Bilinear transformation
[Gd,F] = GRPDELAY(numAPd,denAPd,f,fs);
Gdsec = Gd*T;
[H,F] = freqz(numAPd,denAPd,f,fs);

%----------------------------------
% Filter signal with allpass filter
%----------------------------------

y = filter(numAPd, denAPd, x);

%------------
% Plot result
%------------

figure(1)
semilogx(f,Gdsec)
axis([0 22050 0 0.01])
grid
title('Digital Group Delay Response of AllPass Filter');
xlabel('frequency (Hz)'),ylabel('Group Delay (seconds)')

tsignal = ( 0:(length(x)-1) ).*T ; % convert # samples to time in seconds

figure(2)
plot(tsignal,x,'-') % snapshot of steady-state response
axis([0.000 0.05 -1 1]);
hold on
plot(tsignal,y,':')
hold off
title('Unfiltered (solid) and filtered (dotted) signals');
xlabel('time (seconds)'),ylabel('amplitude')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote