核心提示:MATLAB代做-python代做-FPGA代做-基于广义S变换的图像去噪分型处理方法 …
function [st,t,f] = st(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate)
TRUE = 1;FALSE = 0;verbose = TRUE;
power = FALSE; amplitude = FALSE;
removeedge= TRUE;analytic_signal = TRUE;factor = 1;
if verbose disp(‘ ==============================================’),end % i like a line left blank
if nargin == 0
if verbose disp(‘No parameters inputted.’),end
t=0;,st=-1;,f=0;
return
end
if nargin == 1
minfreq = 0;
maxfreq =150;
% maxfreq = fix(length(timeseries)/2);
samplingrate=0.001;
freqsamplingrate=1;
end
if verbose
disp(sprintf(‘Minfreq = %d’,minfreq))
disp(sprintf(‘Maxfreq = %d’,maxfreq))
disp(sprintf(‘Sampling Rate (time domain) = %d’,samplingrate))
disp(sprintf(‘Sampling Rate (freq. domain) = %d’,freqsamplingrate))
disp(sprintf(‘The length of the timeseries is %d points’,length(timeseries)))
% disp(‘ ‘)
end
t = (0:length(timeseries)-1)*samplingrate;
spe_nelements =ceil((maxfreq – minfreq+1)/freqsamplingrate);
f = (minfreq + [0:spe_nelements-1]*freqsamplingrate)/(samplingrate*length(timeseries));
disp(sprintf(‘t = (0:length(timeseries)-1)*samplingrate = %d’,(length(timeseries)-1)*samplingrate));
disp(sprintf(‘spe_nelements == %d’,spe_nelements));
disp(sprintf(‘f == %d’,(minfreq+(spe_nelements-1)*freqsamplingrate)/(samplingrate*length(timeseries))));
if verbose
disp(sprintf(‘The number of frequency voices is %d’,spe_nelements)),
end
fid2=fopen(‘F:\ZYL_data\S_Tranf\original_0.txt’,’w’);
fprintf(fid2,’%f\n’,timeseries);
% The actual S Transform function is here:
st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor);
%//
% %
% this function is below, thus nicely encapsulated %
% %
%//
function st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor);
% Compute the length of the data.
n=length(timeseries);
original = timeseries;
% % Compute FFT’s
vector_fft=fft(timeseries);
vector_fft=[vector_fft,vector_fft];
%————————————————————————–
fid3=fopen(‘F:\ZYL_data\S_Tranf\vector_fft_3.txt’,’w’);
fprintf(fid3,’%f\n’,vector_fft);
%————————————————————————–
st=zeros(ceil((maxfreq – minfreq+1)/freqsamplingrate),n);%—数组清零
aaa=zeros(ceil((maxfreq – minfreq+1)/freqsamplingrate));
%—–the actual calculation of the ST——Start loop to increment the frequency point
fid4=fopen(‘F:\ZYL_data\S_Tranf\fft(timeseries)_2.txt’,’w’);
fprintf(fid4,’%f\n’,fft(timeseries));
for banana=freqsamplingrate:freqsamplingrate:(maxfreq-minfreq)
st(banana/freqsamplingrate+1,:)=ifft(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor));
% disp(sprintf(‘minfreq+banana+1 == %d minfreq+banana+n ==%d’,minfreq+banana+1,minfreq+banana+n))
fid5=fopen(‘F:\ZYL_data\S_Tranf\ifft(vector_fft_g_window).txt’,’ab+’);
fprintf(fid5,’%f\n’,ifft(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor)));
fid6=fopen(‘F:\ZYL_data\S_Tranf\g_window.txt’,’ab+’);
fprintf(fid6,’%f\n’,g_window(n,minfreq+banana,factor));
fid7=fopen(‘F:\ZYL_data\S_Tranf\real(vector_fft_g_window).txt’,’ab+’);
fprintf(fid7,’%f\n’,real(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor)));
fid8=fopen(‘F:\ZYL_data\S_Tranf\st.txt’,’ab+’);
fprintf(fid8,’%f\n’,st(banana/freqsamplingrate+1,:));
end
% fid=fopen(‘F:\ZYL_data\S_Tranf\st000.txt’,’w’);
% for banana=freqsamplingrate:freqsamplingrate:(maxfreq-minfreq)
% for ii=1:n
% aaa(banana/freqsamplingrate+1)=aaa(banana/freqsamplingrate+1)+st(banana/freqsamplingrate+1,ii);
% end
% fprintf(fid,’%f\n’,aaa(banana/freqsamplingrate+1));
% disp(sprintf(‘banana == %d\n’,banana/freqsamplingrate+1))
% end
disp(sprintf(‘banana = %d’,banana))
disp(sprintf(‘length = n = %d’,n))
disp(sprintf(‘minfreq+banana = %d’,minfreq+banana))
disp(sprintf(‘minfreq+banana+1 = %d’,minfreq+banana+1))
disp(sprintf(‘minfreq+banana+n = %d’,minfreq+banana+n))
disp(sprintf(‘factor = %d’,factor))
if verbose disp(‘Finished Calculation’),end
%————————————————————————end strans function
function gauss=g_window(length,freq,factor)
%—–Inputs Needed————————–
%length-the length of the Gaussian window
%freq-the frequency at which to evaluate
% the window.
%factor- the window-width factor
vector(1,:)=[0:length-1];
vector(2,:)=[-length:-1];%两行length列矩阵
vector=vector.^2;
vector=vector*(-factor*2*pi^2/freq^2);
% Compute the Gaussion window
gauss=sum(exp(vector));%每一列相加。
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^%
联系:highspeedlogic
QQ :1224848052
微信:HuangL1121
邮箱:1224848052@qq.com
微信扫一扫:
今天的文章广义s变换滤波 matlab,MATLAB代做-python代做-FPGA代做-基于广义S变换的图像去噪分型处理方法…分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/32668.html