For example, if the kernel implements a low pass filter, the edge samples will still retain the higher frequency components. Depending on the convolution kernel, there will be an audible difference between these and the processed samples. If edges = leave is specified, the edge samples are left unmodified (copied from the input into the output data verbatim). The edges = edgeMode option controls what is to be done with the edge samples when shape = same. When part of the kernel protrudes past the edge of the input data, the values used for samples outside the data are controlled by the exterior = exteriorMode option described below. Thus, the output data will be larger than the input (by one less than the length of the kernel). If shape = full is specified (the default), a full mathematical convolution is performed, in which any position of the kernel that overlaps the data will produce an output sample. The treatment of the edge samples is then controlled by the edges = edgeMode option described below. If shape = same is specified, the output data will be the same size as the input data. If shape = valid is specified, those samples with too few neighbors are omitted from the convolution, and thus the output data will be smaller than the input data (by one less than the length of the kernel). The shape = shapeMode option controls which samples of the convolution are to be part of the output: The input audio is not modified.įor an N -element kernel, there will be N 2 − 1 2 samples at the beginning and end of the audio data that do not have the required N − 1 neighbors. Then, the sum is divided by the sum of the weights (or 1 if the weights sum to zero), and the sample corresponding to the center of the kernel is given that value in the output audio. The samples covered by the kernel are multiplied by the corresponding entries (weights) in the kernel, and summed up. Each channel of the mask is then used for the corresponding channel of the audio data. When the audio data has more than one channel, the kernel can be specified as an N x M Matrix or Array, where M is equal to the number of channels. The Convolution operation consists of "sliding" the kernel over each channel of the input data, moving it by one sample each time, computing a new sample value for the output channel. The kernel parameter specifies the convolution kernel in the form of an N -element column Vector or Array, or an N x 1 Matrix or Array of numeric values. The audArray parameter specifies the audio data on which to perform the convolution, and must be a dense rectangular Array, Vector, or Matrix with datatype = float, and one or two dimensions. The Convolution command performs a one-dimensional convolution over audio data using a convolution kernel (also known as a convolution mask), and returns a new audio object giving the result of this operation. One or more options modifying the convolution operation Perform a one-dimensional convolution over audio dataĬonvolution( audArray, kernel, options )Īrray, Vector, or Matrix containing the audio data to perform the convolution onĪrray, Vector, or Matrix specifying the convolution kernel/mask
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |