Power of two checking Edit
Wav Reading Edit
Wav Playing Edit
Wav Writing Edit
Peak Detection Edit
This function detects the location of spectral peaks of a frame. It needs the spectrum of a signal and a threshold. This function is from sms-tools package.
Length of File Edit
This function return the length of a file in kbits.
File Writing Edit
This function writes a variable to a file using the bits designed. It is intended to work in a similar way to MATLAB's 'fwrite' function.
File Reading Edit
This function reads values a determined bit-length from a file. It is intended to work in a similar way to MATLAB's 'fread' function.
Open Stream Edit
This function initializes the Stream as a BitString BitStream.
Flush Stream Edit
This function flushes whatever is left in the global stream. Therefore if there were non-Byteable bits, it zero-pad them to Byteable and write them to the file.
Signal to Noise Ratio Edit
This function calculates the total Signal to Noise Ratio (SNR) of the input and que output and a graph of SNR over time using a window determined.
This function convert a lineal frequency specified in hertz to bark scale.
Bin to Bark Edit
This function calculates the masking spectrum for a given frequency and SPL with Schroeder function.
It uses the sampling frequency, the frame length, the frequency peak location in hertz and the difference between the peak and the mask levels in dB. This function uses the function BARK.
Midtread Quantizer Edit
This function quantize a signal in number of levels that we assign. it uses the signal and the number of bits that we want to use.
Midtread Quantizer 2 Edit
This function is a more advanced function based in Midtread quantizer. It can quantize arrays and also check if there has been overlab (therefore some normalisation should be made).
Midtread Dequantizer Edit
This function dequantize a signal quantized in number of levels that we assign. it uses the signal and the number of bits that we want to use.
Modified Discrete Cosine Transform Edit
This function returns the Modified Discrete Cosine Transform of a signal. It needs a vector of a signal.
Inverse Modified Discrete Cosine Transform Edit
This function returns the Inverse of Discrete Cosine Transform of a signal. It needs a vector of Discrete Cosine Transform of a signal.
Bitpool Encoder Edit
This function quantizes the MDCT of a frame with the bits indicated at the 'bit_alloc'. It uses the MDCT of a frame, the sampling frequency, the frame length and bit_alloc (an array containing the bits designed for each band). It returns the quantized gain and the quantized MDCT.
This function split a signal in to frames. We can choose a type of window to enframe each frame and the overlapping.
Bit allocation Edit
This function allocates bits to each band given a certain bitrate (from which a bitpool will be generated). It is based on the SPL 'y' which for the perceptual model is the SMR. For Bands is just the signal SPL.