Code provided here works for 1-D signal. If you want to process it for 2-D signal (ex. GrayScale Image) first process the signal row wise and after that column wise.
Suraj Kamya (2021). DFT & DCT (https://www.mathworks.com/matlabcentral/fileexchange/46526-dft-dct), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!