Using MATLAB signal processing toolbox, I have created signals like dirichlet, chirp and etc and and obtained their fourier and cosine fourier transform. Now I want to find the frequency where for example A% frequencies are less than that and use it as a thresholding frequency to compact the signal and eliminate unnecessary details? Could you please tell me a little more about thresholding frequencies and how to choose them in signal processing?
A Matlab code and illustration is given below, with the discrete cosine transform (DCT):
nSample = 512; pDataThreshold = 90/100 ; % percentage, as a float in [0 1] time = linspace(0,1,nSample)'; data = sin(2*pi*4*sqrt(time)); dataTrans = dct(data); dataThreshold = quantile(abs(dataTrans),pDataThreshold); dataTransThreshold = dataTrans; dataTransThreshold(abs(dataTrans) < dataThreshold) = 0; dataCompact = idct(dataTransThreshold); plot(time,[data,dataCompact]); xlabel('Time') ylabel('Amplitude') legend('Data',['DataCompact (',num2str(100*pDataThreshold),'%)']) grid on