Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

### Matlab for Synthetic Guitar Bridge Admittance

Method 1:

• guaranteed positive real
• No independent control of residues and bandwidths

Method 2:

• Not guaranteed positive real (or is it?) Nulls between resonances make us hopeful
• Have independent control of residues and bandwidths

Other Methods:

Matlab for Method 1:

fs = 8192;  % Sampling rate in Hz
fc = 300;   % Upper frequency to look at
nfft = 8192;% FFT size (spectral grid density)

nspec = nfft/2+1;
nc = round(nfft*fc/fs);
f = ([0:nc-1]/nfft)*fs;

% Measured guitar body resonances
F = [4.64 96.52 189.33 219.95]; % frequencies
B = [ 10   20     40     50  ]; % bandwidths

nsec = length(F);

R = exp(-pi*B/fs);     % Pole radii
theta = 2*pi*F/fs;     % Pole angles
poles = R .* exp(j*theta);
A1 = -2*R.*cos(theta);  % 2nd-order section coeff
A2 = R.*R;              % 2nd-order section coeff
denoms = [ones(size(A1)); A1; A2]'
A = [1,zeros(1,2*nsec)];

for i=1:nsec,
% polynomial multiplication = FIR filtering:
A = filter(denoms(i,:),1,A);
end;


Now A contains the (stable) denominator of the desired bridge admittance. We want now to construct a numerator which gives a positive-real result. We'll do this by first creating a passive reflectance and then computing the corresponding PR admittance.

g = 0.9;          % Uniform loss factor
B = g*fliplr(A);  % Flip(A)/A = desired allpass

% Plots

nc = round(nfft*fc/fs);
spec = fr(1:nc);
f = ([0:nc-1]/nfft)*fs;
dbmag = db(spec);
phase = angle(spec)*180/pi;

subplot(2,1,1);
plot(f,dbmag); grid;
ylabel('Magnitude (dB)');
subplot(2,1,2);

plot(f,phase); grid;
ylabel('Phase (degrees)');
xlabel('Frequency (Hz)');


Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search