ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PDL-Audio/audio.pd
(Generate patch)

Comparing PDL-Audio/audio.pd (file contents):
Revision 1.5 by root, Tue Dec 28 02:02:59 2004 UTC vs.
Revision 1.6 by root, Tue Dec 28 02:14:49 2004 UTC

13 use PDL; 13 use PDL;
14 use PDL::Audio; 14 use PDL::Audio;
15 15
16=head1 DESCRIPTION 16=head1 DESCRIPTION
17 17
18Oh well ;) Not much "introductury documentation" has been written yet! See 18Oh well ;) Not much "introductory documentation" has been written yet :(
19my other modules for even worse documentation ;)
20 19
21=head2 NOTATION 20=head2 NOTATION
22 21
23Brackets around parameters indicate that the respective parameter is 22Brackets around parameters indicate that the respective parameter is
24optional and will be replaced with some default value when absent (or 23optional and will be replaced with some default value when absent (or
753in C<table>, linearly interpolating between successive points of the 752in C<table>, linearly interpolating between successive points of the
754C<waveform>. 753C<waveform>.
755 754
756=head2 partials2waveshape size*, partials, amplitudes, [phase], [fm_mod/] 755=head2 partials2waveshape size*, partials, amplitudes, [phase], [fm_mod/]
757 756
758Take a list (perl list or pdl) of (integer) C<partials> and a list of 757Take a (perl or pdl) list of (integer) C<partials> and a list of
759C<amplitudes> and generate a single wave shape that results by adding 758C<amplitudes> and generate a single wave shape that results by adding
760these partial sines. 759these partial sines.
761 760
762This could (and should) be used by the C<gen_from_table> generator. 761This could (and should) be used by the C<gen_from_table> generator.
763 762
764=head2 gen_from_partials duration*, frequency/, partials, amplitudes, [phase], [fm_mod/] 763=head2 gen_from_partials duration*, frequency/, partials, amplitudes, [phase], [fm_mod/]
765 764
766Take a list (perl list or pdl) of (possibly noninteger) C<partials> and a 765Take a (perl list or pdl) list of (possibly noninteger) C<partials> and a
767list of C<amplitudes> and generate the waveform resulting by summing up 766list of C<amplitudes> and generate the waveform resulting by summing up
768all these partial sines. 767all these partial sines.
769 768
770=cut 769=cut
771 770
1209Calculates the optimal (in the Chebyshev/minimax sense) FIR filter 1208Calculates the optimal (in the Chebyshev/minimax sense) FIR filter
1210impulse response given a set of band edges, the desired reponse on those 1209impulse response given a set of band edges, the desired reponse on those
1211bands, and the weight given to the error in those bands, using the 1210bands, and the weight given to the error in those bands, using the
1212Parks-McClellan exchange algorithm. 1211Parks-McClellan exchange algorithm.
1213 1212
1214The first argument (the one with the funny name) sets the filter 1213The first argument sets the filter size: C<design_remez_fir> returns as
1215size: C<design_remez_fir> returns as many coefficients as specified via 1214many coefficients as specified by this parameter.
1216this parameter.
1217 1215
1218C<bands> is a vector of band edge pairs (start - end), who specify the 1216C<bands> is a vector of band edge pairs (start - end), which specify the
1219start and end of the bands in the filter specification. These must be 1217start and end of the bands in the filter specification. These must be
1220non-overlapping and sorted in increasing order. Only values between C<0> 1218non-overlapping and sorted in increasing order. Only values between C<0>
1221(0 Hz) and C<0.5> (the Nyquist frequency) are allowed. 1219(0 Hz) and C<0.5> (the Nyquist frequency) are allowed.
1222 1220
1223C<des> specifies the desired gain in these bands. 1221C<des> specifies the desired gain in these bands.
1653 1651
1654=head2 spectrum data, [norm], [window], [beta] 1652=head2 spectrum data, [norm], [window], [beta]
1655 1653
1656Returns the spectrum of a given pdl. If C<norm> is absent (or C<undef>), 1654Returns the spectrum of a given pdl. If C<norm> is absent (or C<undef>),
1657it returns the magnitude of the fft of C<data>. When C<norm> == 1 (or 1655it returns the magnitude of the fft of C<data>. When C<norm> == 1 (or
1658C<eq 'NORM'>, in any case), it returns the magnitude, normalized to be 1656C<eq 'NORM'>, case-insensitive), it returns the magnitude, normalized to be
1659between zero and one. If C<norm> == 0 (or C<eq 'dB'>, in any case), then 1657between zero and one. If C<norm> == 0 (or C<eq 'dB'>, case-insensitive), then
1660it returns the magnitude in dB. 1658it returns the magnitude in dB.
1661 1659
1662C<data> is multiplied with C<window> (if not C<undef>) before calculating 1660C<data> is multiplied with C<window> (if not C<undef>) before calculating
1663the fft, and usually contains a window created with C<gen_fft_window> 1661the fft, and usually contains a window created with C<gen_fft_window>
1664(using C<beta>). If C<window> is a string, it is handed over to 1662(using C<beta>). If C<window> is a string, it is handed over to

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines