Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

OpenDAFF

Code

OpenDAFF Code

Directional Audio File Format

Brought to you by: fwefers, jstienen, laspoeck

Summary

Files

Reviews

Support

Code

Mailing Lists

OpenDAFF official website

Menu ▾ ▴

Browse Commits

Fork

Merge Requests 0

Forks 1

Branches

master

develop

[9925ad]: / matlab / Tests / multichannel_test_callback_function.m  Maximize  Restore  History

Download this file

37 lines (31 with data), 1.3 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

function [ freqs, mags, metadata ] = multichannel_test_callback_function( alpha, beta, basepath )

% Example magnitude spectrum of bulb shape for higher frequencies

% This is just an example directivity.

% For low frequencies it is omnidirectional

% For higher frequencies it focusses in the frontal direction

% Third-octave resolution

freqs = [20 25 31.5 40 50 63 80 100 125 160 ...

200 250 315 400 500 630 800 1000 1250 1600 ...

2000 3150 4000 5000 6300 8000 10000 12500 16000 20000];

channels = 3;

mags = zeros(channels, length(freqs));

metadata = [];

for c=1:channels

for f=1:length(freqs)

% Great circle angle - Spherical law of cosines

phi = acos( cos(alpha*pi/180) * cos( (beta-90) *pi/180) ) * 180/pi;

% Exponential weighting lamba

% 20 Hz -> 0, 20 kHz -> 0.002

lambda = 0.002 * freqs(f) / 10000;

% Frequency weighting

w = log(freqs(f)) / log(20000) / 2;

if c==1

mags(c,f) = (1-w) + w*exp(-lambda*phi^2);

elseif c==2

mags(c,f) = c*f/100;

else

mags(c,f) = freqs(f)/20000;

end

end

end

end

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit