Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Ads

Chapters

See Also

Embedded SystemsFPGAElectronics
Chapter Contents:

Search Physical Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Matlab for Method 1

fs = 8192;  % Sampling rate in Hz (small for display convenience)
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   10     10     10  ]; % 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

Badm = A - B;
Aadm = A + B;
Badm = Badm/Aadm(1); % Renormalize
Aadm = Aadm/Aadm(1);

% Plots

fr = freqz(Badm,Aadm,nfft,'whole');

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;
title('Synthetic Guitar Bridge Admittance');
ylabel('Magnitude (dB)');
subplot(2,1,2);

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


Order a Hardcopy of Physical Audio Signal Processing

Previous: Method 2
Next: Matlab for Method 2

written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )