Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
6ae17bf4
Commit
6ae17bf4
authored
Jan 25, 2017
by
Michael Kohnen
Browse files
Merge branch 'master' of
http://git.rwth-aachen.de/ita/toolbox
parents
c1c9fdc9
6c4f8fb0
Changes
6
Hide whitespace changes
Inline
Side-by-side
ExternalPackages/PlotComet_3D/PlotComet_3D.m
View file @
6ae17bf4
...
...
@@ -66,18 +66,24 @@ blockSize = floor(1/20*length(x_data));
tailFormat
=
struct
(
'LineWidth'
,
1
,
'Color'
,
'r'
,
'LineStyle'
,
'-'
);
headFormat
=
struct
(
'LineStyle'
,
'none'
,
'Marker'
,
'o'
,
'MarkerSize'
,
6
,
...
'Color'
,
'b'
);
pointFormat
=
struct
(
'LineStyle'
,
'none'
,
'Marker'
,
'o'
,
'MarkerSize'
,
6
,
...
'Color'
,
'g'
);
plotPoints
=
0
;
returnFrames
=
0
;
colorSwitch
=
0
;
moveTail
=
0
;
%parse out the inputs
argCount
=
nargin
-
3
;
for
i
=
1
:
2
:
argCount
for
i
ndex
=
1
:
2
:
argCount
% caseVar = varargin{i}
switch
varargin
{
i
}
switch
varargin
{
i
ndex
}
case
'cFigure'
cFigure
=
varargin
{
i
+
1
};
cFigure
=
varargin
{
i
ndex
+
1
};
%get the original size:
cAxes
=
get
(
cFigure
,
'CurrentAxes'
);
xLim
=
get
(
cAxes
,
'XLim'
);
...
...
@@ -112,15 +118,27 @@ for i = 1:2:argCount
axis
([
xLim
,
yLim
,
zLim
]);
case
'blockSize'
blockSize
=
varargin
{
i
+
1
};
blockSize
=
varargin
{
i
ndex
+
1
};
case
'Frequency'
freq
=
varargin
{
i
+
1
};
freq
=
varargin
{
i
ndex
+
1
};
case
'tailFormat'
tailFormat
=
varargin
{
i
+
1
};
tailFormat
=
varargin
{
i
ndex
+
1
};
case
'headFormat'
headFormat
=
varargin
{
i
+
1
};
headFormat
=
varargin
{
index
+
1
};
case
'plotPoints'
plotPoints
=
varargin
{
index
+
1
};
case
'returnFrames'
returnFrames
=
varargin
{
index
+
1
};
case
'colorSwitch'
colorSwitch
=
varargin
{
index
+
1
};
case
'moveTail'
moveTail
=
varargin
{
index
+
1
};
end
end
...
...
@@ -152,43 +170,126 @@ pauseTime = 1./freq;
n_start
=
1
;
n_stop
=
1
;
frames
=
[];
deleteList
=
[];
%put on the starting point
plot3
(
x_data
(
n_start
:
n_stop
),
...
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
n_start
:
n_stop
),
...
y_data
(
n_start
:
n_stop
),
...
z_data
(
n_start
:
n_stop
),
tailFormat
);
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
headFormat
);
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
headFormat
);
if
returnFrames
frames
{
end
+
1
}
=
getframe
(
gcf
);
end
% prepare the colormap
if
colorSwitch
colormap
(
'jet'
);
colorValues
=
colormap
;
colorValues
=
[
colorValues
;[
0
0
0
]];
indexFactor
=
3.882
/
1.335
;
else
indexFactor
=
1
;
end
if
length
(
moveTail
)
>
1
tailX_data
=
squeeze
(
moveTail
(:,
1
,:));
tailY_data
=
squeeze
(
moveTail
(:,
2
,:));
tailZ_data
=
squeeze
(
moveTail
(:,
3
,:));
end
n_blocks
=
length
(
x_data
)/
blockSize
;
i_blocks
=
0
;
%playback!
for
n
=
1
:
1
:
length
(
x_data
)
for
n
=
1
:
1
:
ceil
(
length
(
x_data
)
+
length
(
x_data
)/(
n_blocks
*
indexFactor
))
a
=
tic
;
%delete the previous plot
hChild
=
get
(
cAxes
,
'Children'
);
delete
(
hChild
(
1
:
2
));
if
n
<=
blockSize
n_start
=
1
;
if
n
<=
blockSize
*
(
i_blocks
+
1
)
n_start
=
blockSize
*
i_blocks
+
1
;
n_stop
=
n
;
else
n_start
=
n_start
+
1
;
n_stop
=
n_stop
+
1
;
i_blocks
=
i_blocks
+
1
;
n_start
=
blockSize
*
i_blocks
+
1
;
n_stop
=
n
;
deleteList
=
deleteList
(
2
:
end
);
end
%delete the previous plot
for
index
=
1
:
length
(
deleteList
)
delete
(
deleteList
{
index
});
end
deleteList
=
[];
if
n
>
length
(
x_data
)
% n_start = 1;
n_stop
=
length
(
x_data
);
end
%new plot
plot3
(
x_data
(
n_start
:
n_stop
),
...
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
n_start
:
n_stop
),
...
y_data
(
n_start
:
n_stop
),
...
z_data
(
n_start
:
n_stop
),
tailFormat
);
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
headFormat
);
if
plotPoints
for
index
=
1
:
n_stop
-
1
if
colorSwitch
colorIndex
=
round
((
n
-
(
index
-
1
))
*
indexFactor
);
if
colorIndex
>=
length
(
colorValues
)
colorIndex
=
length
(
colorValues
);
end
pointColor
=
colorValues
(
colorIndex
,:);
pointFormat
=
struct
(
'LineStyle'
,
'none'
,
'Marker'
,
'o'
,
'MarkerSize'
,
6
,
'Color'
,
pointColor
);
end
if
moveTail
==
0
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
index
),
y_data
(
index
),
z_data
(
index
),
pointFormat
);
else
if
colorIndex
~=
length
(
colorValues
)
% point
deleteList
{
end
+
1
}
=
plot3
(
tailX_data
(
index
,
colorIndex
),
tailY_data
(
index
,
colorIndex
),
tailZ_data
(
index
,
colorIndex
),
pointFormat
);
end
% tail
deleteList
{
end
+
1
}
=
plot3
(
tailX_data
(
index
,
1
:
colorIndex
),
...
tailY_data
(
index
,
1
:
colorIndex
),
...
tailZ_data
(
index
,
1
:
colorIndex
),
tailFormat
);
end
end
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
headFormat
);
else
deleteList
{
end
+
1
}
=
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
headFormat
);
end
drawnow
;
if
returnFrames
frames
{
end
+
1
}
=
getframe
(
gcf
);
end
%update playback refresh rate
b
=
toc
(
a
);
pause
(
pauseTime
-
b
);
end
if
plotPoints
plot3
(
x_data
(
n_stop
),
y_data
(
n_stop
),
z_data
(
n_stop
),
pointFormat
);
drawnow
;
if
returnFrames
frames
{
end
+
1
}
=
getframe
(
gcf
);
end
end
set
(
cAxes
,
'NextPlot'
,
oldNextPlot
);
% fprintf('Finished\n');
if
nargout
==
1
varargout
{
1
}
=
cFigure
;
end
if
returnFrames
varargout
{
2
}
=
frames
;
end
applications/SignalProcessing/Beamforming/ita_beam_beampattern.m
View file @
6ae17bf4
...
...
@@ -47,7 +47,11 @@ sArgs = struct('pos1_array','itaMicArray','pos2_f','numeric','pos3_steering_th',
%% do the calculation
% positions of array microphones
arrayPositions
=
array
.
cart
;
if
isempty
(
array
.
weights
)
||
numel
(
array
.
weights
)
~=
array
.
nPoints
weights
=
array
.
w
;
else
weights
=
array
.
weights
;
end
% make a matrix with spherical coordinates for the unit sphere with
% given angular resolution
resolution
=
1
;
...
...
@@ -67,7 +71,7 @@ k = 2*pi*f/double(ita_constants('c'));
v
=
squeeze
(
ita_beam_steeringVector
(
k
,
arrayPositions
,
scanPositions
,
sArgs
.
wavetype
));
% ... and multiply with the manifold vector for the steering
% direction to get the beampattern
v_steer
=
ita_beam_steeringVector
(
k
,
arrayPositions
,
steer_vec
,
sArgs
.
wavetype
)
.'
;
v_steer
=
weights
(:)
.*
ita_beam_steeringVector
(
k
,
arrayPositions
,
steer_vec
,
sArgs
.
wavetype
)
.'
;
v
=
v
'*
v_steer
.
/
sum
(
abs
(
v_steer
)
.^
2
);
B
=
reshape
(
v
,
numel
(
theta
),
numel
(
phi
));
...
...
@@ -75,7 +79,7 @@ B = B./max(abs(B(:))); % normalize to maximum
if
~
strcmpi
(
sArgs
.
plotPlane
,
'none'
)
v
=
itaResult
(
v
(:)
.
'./max(abs(v(:))),f,'
freq
'
);
v
.
channelCoordinates
=
itaCoordinates
(
scanPositions
.'
);
v
.
channelCoordinates
=
itaCoordinates
(
scanPositions
);
if
(
strcmpi
(
sArgs
.
plotPlane
,
'xyz'
)
||
strcmpi
(
sArgs
.
plotPlane
,
'3d'
))
switch
sArgs
.
plotType
case
'lin'
...
...
applications/SphericalHarmonics/ita_sph_sampling/ita_sph_sampling_equalarea.m
View file @
6ae17bf4
...
...
@@ -51,7 +51,7 @@ end
while
true
coordsCart
=
eq_point_set
(
2
,
sArgs
.
nPoints
)
.'
;
sampling
=
itaSamplingSph
(
coordsCart
,
'cart'
);
Y
=
mbe
_sph_base
(
sampling
,
Nmax
);
Y
=
ita
_sph_base
(
sampling
,
Nmax
);
condNum
=
cond
(
Y
);
if
condNum
<
sArgs
.
condSHT
break
;
...
...
applications/SphericalHarmonics/ita_sph_sampling/ita_sph_sampling_spiral_points.m
View file @
6ae17bf4
...
...
@@ -52,7 +52,7 @@ end
while
true
coordsCart
=
calculate_spiral_points
(
sArgs
.
nPoints
);
sampling
=
itaSamplingSph
(
coordsCart
,
'sph'
);
Y
=
mbe
_sph_base
(
sampling
,
Nmax
);
Y
=
ita
_sph_base
(
sampling
,
Nmax
);
condNum
=
cond
(
Y
);
if
condNum
<
sArgs
.
condSHT
break
;
...
...
kernel/ClassStuff/@itaCoordinates/comet3.m
View file @
6ae17bf4
...
...
@@ -5,13 +5,9 @@ function [ varargout ] = comet3(this,varargin )
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder.
% </ITA-Toolbox>
hFig
=
PlotComet_3D
(
this
.
x
,
this
.
y
,
this
.
z
,
varargin
{:});
xlabel
(
'X'
);
ylabel
(
'Y'
);
zlabel
(
'Z'
);
axis
equal
vis3d
[
hFig
,
frames
]
=
PlotComet_3D
(
this
.
x
,
this
.
y
,
this
.
z
,
varargin
{:});
if
nargout
varargout
=
{
hFig
};
varargout
=
{
hFig
,
frames
};
else
varargout
=
{};
end
...
...
license.txt
View file @
6ae17bf4
...
...
@@ -5,52 +5,56 @@
********************************************************************************
********************************************************************************
** **
** (C) All rights reserved. 2008-2016 **
** **
** The ITA-Toolbox for MATLAB is a non-commercial tool and should only be **
** used for non-commercial work, e.g. self-study, research without financial **
** profit. The Institute of Technical Acoustics at RWTH Aachen University **
** (in the following short: ITA ) is not responsible for any damage caused **
** by the use of the ITA-Toolbox. **
** **
** The ITA-Toolbox is provided as is, and the Institute does not offer any **
** support for this Toolbox. The source code may be edited. Improvements **
** should be send to the developer team to be included in future versions **
** of the ITA-Toolbox with acknowledgments to the editors. **
** **
** Users of ITA-Toolbox are kindly asked to add the following line in the **
** Acknowledgments section in publications if the ITA-Toolbox was used in **
** this particular work or research. **
** **
** Text to add: "The ITA-Toolbox for MATLAB developed at the Institute of **
** Technical Acoustics at RWTH Aachen has been used for data processing." **
** **
** Distribution of the ITA-Toolbox without an official allowance by the **
** Institute of Technial Acoustics is prohibited. The use of ITA-Toolbox **
** for any profitable work, e.g. acoustic consulting, prototype developement **
** is prohibited as not officially allowed by the Institute of Technical **
** Acoustics at RWTH Aachen University otherwise. **
** **
** It is prohibited to distribute THIS APPLICATIONS folder developed for the **
** ITA-Toolbox by the ITA under any circumstances. **
** **
** A free license key for the kernel can be obtained via **
** http://ita-toolbox.org/ **
** for non-commercial use. **
** Copyright (c) 2011 **
** Institute of Technical Acoustics (RWTH Aachen University) **
** All rights reserved. **
** **
** Redistribution and use in source and binary forms, with or without **
** modification, are permitted provided that the following conditions are **
** met: **
** **
** 1. Redistributions of source code must retain the above copyright **
** notice, this list of conditions and the following disclaimer. **
** 2. Redistributions in binary form must reproduce the above copyright **
** notice, this list of conditions and the following disclaimer in the **
** documentation and/or other materials provided with the distribution. **
** 3. All advertising materials mentioning features or use of this **
** software must display the following acknowledgement: **
** **
** This product includes software developed by the **
** Institute of Technical Acoustics (RWTH Aachen University). **
** **
** 4. Neither the name of the Institute of Technical Acoustics (RWTH **
** Aachen University), nor the names of its contributors may be used to **
** endorse or promote products derived from this software without **
** specific prior written permission. **
** **
** THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TECHNICAL ACOUSTICS (RWTH **
** AACHEN UNIVERSITY) ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, **
** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY **
** AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL **
** INSTITUTE OF TECHNICAL ACOUSTICS (RWTH AACHEN UNIVERSITY) BE LIABLE FOR **
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL **
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS **
** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) **
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, **
** STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN **
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE **
** POSSIBILITY OF SUCH DAMAGE. **
** **
********************************************************************************
** **
**
Developed at the Institute of Technical Acoustics, **
**
RWTH Aachen University, Kopernikusstr. 5, 52074 Aachen
**
**
Head: Prof. Dr. rer. nat. Michael Vorlaender **
** Developed at the Institute of Technical Acoustics,
**
** RWTH Aachen University, Kopernikusstr. 5, 52074 Aachen
, Germany
**
** Head: Prof. Dr. rer. nat. Michael Vorlaender
**
** **
**
Active Developers: **
**
M.Sc. Marco Berzborn **
** Active Developers:
**
**
M.Sc. Marco Berzborn **
** Dipl.-Ing. Ramona Bomhardt **
** Dipl.-Ing. Johannes Klein **
** Dipl.-Ing. Jan-Gerrit Richter **
** **
**
Former Developers: **
**
Former Developers:
**
** Dr.-Ing. Pascal Dietrich **
** Dr.-Ing. Martin Guski **
** Dr.-Ing. Bruno Masiero **
...
...
@@ -58,7 +62,7 @@
** Dr.-Ing. Martin Pollow **
** Dr.-Ing. Roman Scharrer **
** **
**
Contact: toolbox-dev@akustik.rwth-aachen.de **
**
Contact: toolbox-dev@akustik.rwth-aachen.de
**
** **
********************************************************************************
********************************************************************************
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment