Code covered by the BSD License
-
AD_DA(x,Xmin,Xmax,Levels)
This function represents an A/D converter in series with a D/A converter
-
conv_DHT(x,h)
Linear Convolution calculated via the Discrete Hartley Transform (DHT).
-
diffft(x)
Decimation-In-Frequency (DIF) FFT.
-
fastconv(x,y)
Compute a linear (or circular, depending on relative signal lengths) convolution via DFT's.
-
fastconv2(x,y)
Compute a linear convolution via DFT's.
-
fastconv3(x,y,nx,ny)
Compute a linear convolution via DFT's.
-
fft241(x,y)
This function calculates the DFT's of two real N-point sequences, by means of
-
fftreal(x)
This function calculates the FFT of an N-point real signal x[n] by use
-
fraction_delay(x, h, N)
This function induces a fractional sample delay by 1/N to the input signal x.
-
fraction_delay2(x, h, N)
This is a later version of custom function fraction_delay.m
-
fraction_sample(x,h,M,N)
Fractional Sampling Rate Conversion function by a factor of M/N.
-
ifft241(X,Y)
This function calculates the IDFT's of 2 given complex DFT sequences of common length N,
-
ifftreal(X)
This function computes the ifft of an N-point complex DFT sequence which corresponds
-
ifftreal2(X)
This function computes the ifft of an N-point complex DFT sequence which corresponds
-
method2_idft(X)
-
method3_idft(X)
-
my_CTFT(x,dt,freq_type)
Continuous Time Fourier Transform Approximation.
-
my_CZT(x,M,W,A)
Fast chirp z-transform (CZT) computation.
-
my_Co_IDCT(X)
Inverse Discrete Cosine Transform Computation.
-
my_DCT(x)
Discrete Cosine Transform Computation.
-
my_DCT_2D(X)
Two-dimensional DCT computation.
-
my_DFT(x)
This function calculates the DFT of the input signal x.
-
my_DFT2(x)
Direct DFT Computation using the definition formula.
-
my_DHT(x)
This function calculates the Discrete Hartley Transform of a real
-
my_DHT2(x,time_ind)
This function calculates the Discrete Hartley Transform of a real
-
my_DTFT(x,n)
DTFT Computation using the definition formula.
-
my_DTFT2(x,n,w)
DTFT Computation using the definition formula.
-
my_DTFT3(x,n1)
DTFT Computation using the definition formula.
-
my_FFT_2D(X)
Two-dimensional DFT computation.
-
my_IDCT(X)
Inverse Discrete Cosine Transform Computation.
-
my_IDCT_2D(X)
Two-dimensional Inverse DCT computation.
-
my_IDFT(X)
This function calculates the Inverse DFT of the input signal X.
-
my_IFFT_2D(X)
Two-dimensional Inverse FFT computation.
-
my_Re_IDCT(X)
Discrete Cosine Transform Computation.
-
my_conv(x,h,nx,nh)
This function computes the linear convolution of input signals x[n] and h[n].
-
my_conv2(x,h,nx,nh)
This function computes the linear convolution of input signals x[n] and h[n].
-
my_downsample(x,M)
This function performs downsampling to input row vector x
-
my_spectrogram(x,Fs,N,M,win_t...
This function calculates the spectrogram of the input signal x.
-
my_upsample(x,N)
This function performs upsampling to input row vector x
-
overlap_add(x,h,half_segment_...
Linear Convolution computation by use of overlap-and-add method.
-
overlap_save(x,h,segment_leng...
Linear Convolution computation via the Overlap-and-Save method.
-
overlap_save2(x,h,segment_len...
Linear Convolution computation via the Overlap-and-Save method. Version 2.
-
radix2fft(x)
Radix-2, Decimation-In-Time (DIT), FFT Computation function.
-
radix4fft(x)
Radix-4, Decimation-In-Time (DIT), FFT Computation function.
-
shiftdown(x,n)
This function shifts down (up) the contents of a column vector
-
shiftright(x,n)
This function shifts to the right (left) the contents of a row vector
-
splitradixfft(x)
Split-Radix, Decimation-In-Time (DIT),FFT Computation function.
-
uniform_quantizer(x,L,max_lev...
This function implements a uniform quantizer of L levels.
-
zero_phase_dft(x)
This function is an implementation of the "zero phase DFT" of a given
-
zero_phase_dtft(x,M)
This function is an implementation of the "zero phase DTFT" of a given
-
bench_dtft.m
-
bench_fft.m
-
ex213.m
-
ex214.m
-
ex216.m
-
ex217.m
-
ex231.m
-
ex232.m
-
ex233.m
-
ex234.m
-
ex235.m
-
ex236.m
-
ex245.m
-
ex246.m
-
ex247.m
-
ex248.m
-
ex249.m
-
ex311.m
-
ex3110.m
-
ex3111.m
-
ex312.m
-
ex314.m
-
ex315.m
-
ex316.m
-
ex317.m
-
ex318.m
-
ex319.m
-
ex321.m
-
ex322.m
-
ex323.m
-
ex324.m
-
ex331.m
-
ex332.m
-
ex333.m
-
ex411.m
-
ex412.m
-
ex413.m
-
ex414.m
-
ex415.m
-
ex421.m
-
ex422.m
-
ex423.m
-
ex424.m
-
ex431.m
-
ex432.m
-
ex433.m
-
ex435.m
-
ex436.m
-
ex437.m
-
ex438.m
-
ex5110.m
-
ex5111.m
-
ex513.m
-
ex518.m
-
ex519.m
-
ex521.m
-
ex5210.m
-
ex522.m
-
ex524.m
-
ex525.m
-
ex527.m
-
ex528.m
-
ex541a.m
-
ex541b.m
-
ex542a.m
-
ex542b.m
-
ex542c.m
-
ex542d.m
-
ex542e.m
-
ex544.m
-
ex545a.m
-
ex545b.m
-
ex546.m
-
ex611.m
-
ex612.m
-
ex613.m
-
ex614.m
-
ex621.m
-
ex622.m
-
ex623.m
-
ex624.m
-
ex625.m
-
ex626.m
-
ex631.m
-
ex632.m
-
ex633.m
-
ex634.m
-
ex635b.m
-
ex635c.m
-
ex636.m
-
ex637.m
-
ex641.m
-
ex642.m
-
ex643.m
-
ex644.m
-
ex645.m
-
ex651.m
-
ex653.m
-
ex654.m
-
ex655.m
-
ex656.m
-
spectro_demo.m
-
test_fastconv3.m
-
test_idct.m
-
test_idct2D.m
-
test_ifft241.m
-
View all files
|
|
| my_DCT(x)
|
function X = my_DCT(x)
% Discrete Cosine Transform Computation.
% This function computes the DCT of a real or complex input signal x[n]
% stored in vector x by use of it's relationship with the DFT.
% First convert input vector x to a row vector for subsequent processing:
x = x(:).';
N = length(x);
% Create the following symmetric sequence y[n] = x[n] + x[2N-n-1].
x1 = [x fliplr(x)];
Y = fft(x1); % Take the 2N-point DFT of the new sequence.
k = 0:N-1;
phasor = exp(-1i*pi*k/(2*N));
% Multiply the first N elements of Y with the complex phasor.
if isreal(x)
X = real(phasor.*Y(1:N));
else
X = phasor.*Y(1:N);
end
% Scale as necessary to make it consistent with the MatLab dct.m function.
X = [1/(2*sqrt(N))*X(1) 1/sqrt(2*N)*X(2:end)];
|
|
Contact us