The running time of quicksort can be improved in practice by taking advantage of the fast
running time of insertion sort when its input is “nearly” sorted. When quicksort is called on a
subarray with fewer than k elements, let it simply return without sorting the subarray. After the
top-level call to quicksort returns, run insertion sort on the entire array to finish the sorting process.
Matlab 畫三維立體圖形
The aim of geom3d library is to handle and visualize 3D geometric primitives
such as points, lines, planes, polyhedra... It provides low-level functions
for manipulating 3D geometric primitives, making easier the development of more
complex geometric algorithms.
Some features of the library are:
- creation of various shapes (3D points, 3D lines, planes, polyhedra...)
through an intuitive syntax.
Ex: createPlane(p1, p2, p3) to create a plane through 3 points.
- derivation of new shapes: intersection between 2 planes, intersection between
a plane and a line, between a sphere and a line...
- functions for 3D polygons and polyhedra. Polyhedra use classical vertex-faces
arrays (face array contain indices of vertices), and support faces with any
number of vertices. Some basic models are provided (createOctaedron,
createCubeoctaedron...), as well as some computation (like faceNormal or
centroid)
- manipulation of planar transformation. Ex.:
ROT = createRotationOx(THETA);
P2 = transformPoint3d(P1, ROT);
- direct drawing of shapes with specialized functions. Clipping is performed
automatically for infinite shapes such as lines or rays. Ex:
drawPoint3d([50 50 25; 20 70 10], 'ro'); % draw some points
drawLine3d([X0 Y0 Z0 DX DY DZ]); % clip and draw straight line
Some functions require the geom2d package.
Additional help is provided in geom3d/Contents.m file, as well as summary files
like 'points3d.m' or 'lines3d.m'.
Computes all eigenvalues and eigenvectors of a real symmetric matrix a,
! which is of size n by n, stored in a physical np by np array.
! On output, elements of a above the diagonal are destroyed.
! d returns the eigenvalues of a in its first n elements.
! v is a matrix with the same logical and physical dimensions as a,
! whose columns contain, on output, the normalized eigenvectors of a.
! nrot returns the number of Jacobi rotations that were required.
! Please notice that the eigenvalues are not ordered on output.
! If the sorting is desired, the addintioal routine "eigsrt"
! can be invoked to reorder the output of jacobi.
This report presents a tutorial of fundamental array processing and beamforming theory relevant to microphone array speech processing. A microphone array consists of multiple microphones placed at different spatial locations. Built upon a knowledge of sound propagation principles, the multiple inputs can be manipulated to enhance or attenuate signals emanating from particular directions. In this way, microphone arrays provide a means of enhancing a desired signal in the presence of corrupting noise sources. Moreover, this enhancement is based purely on knowledge of the source location, and so microphone array techniques are applicable to a wide variety of noise types. Microphone arrays have great potential in practical applications of speech processing, due to their ability to provide both noise robustness and hands-free signal acquisition.