Download
Welcome to SOFiA
Who is behind SOFiA
Feature overview
System overview
Function reference
readVSAdata
mergeArrayData
F/D/T
gauss
lebedev
S/W/G
S/T/C
W/G/C
S/F/E
M/F
R/F/I
P/D/C
I/T/C
makeMTX
makeIR
visual3D
Coordinate System
Application Examples
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Example 7
Example 8
Array Datasets
VariSphear system
Groups and Mailinglists
Contact and Support
How to Reference

SOFiA application example 7

In this example we simulate a plane wave impact to a rigid sphere array sampling at discrete positions using S/W/G. We render impulse responses for two different pwd directions. Play around with the configurations to observe the influence of spatial aliasing.

File(s)

Run `sofiaAE7.m`.

Output


Code

/*
% SOFiA example 7: Impulse response reconstruction on a simulated sampled unity plane wave.
% SOFiA Version : R11-1220

clear all
clc
% Generate a full audio spectrum plane wave using S/W/G

r = 0.2; % Array radius
ac = 2; % Rigid Sphere Array
FS = 24000; % Sampling Frequency
NFFT = 1024; % FFT-Bins
AZ = 0; % Azimuth angle
EL = pi/2; % Elevation Angle

quadrature_grid = sofia_lebedev(110, 0); % EXAMPLE GRID LEB110, No Plot

[fftData, kr] = sofia_swg(r, quadrature_grid, ac, FS, NFFT, AZ, EL);

% Spatial Fourier Transform

Nsft = 5; % Transform order
Pnm = sofia_stc(Nsft, fftData, quadrature_grid);

% Make radial filters

Nrf = Nsft; % radial filter order
limit = 150; % Amplification Limit (Keep the result numerical stable at low frequencies)

dn = sofia_mf(Nrf, kr, ac, limit);

% Running a plane wave decomposition for different look directions
Npdc = Nsft; % Decomposition order
OmegaL = [0 pi/2; pi/2 pi/2]; % Looking towards the wave and to one side

Y = sofia_pdc(Npdc; OmegaL; Pnm; dn);

Reconstruct impulse responses

impulseResponses = sofia_makeIR(Y,0);

% Make IR causal:
impulseResponses = [impulseResponses(:,end/2+1:end), impulseResponses(:,1:end/2)];

% Plot results (Impulse Responses)

figure(1)
subplot(1,2,1)
plot(impulseResponses')
title('Impulse response');
xlabel('Samples');
ylabel('Amplitude');

axis([-100 NFFT -0.2 1.2])
grid on

% Plot results (Spectra)

spectrum = abs(fft(impulseResponses'));
fscale = FS/2*linspace(0,1,NFFT/2+1);

subplot(1,2,2)
semilogx(fscale;20*log10(spectrum(1:end/2+1,:)))
title('Spectrum');
xlabel('Frequency in Hz')
ylabel('Magnitude');
axis(50 FS/2 -60 30)
grid on

*/