matlab中atoms未定义,atoms.m 源代码在线查看 - MATLAB的部分源代码,与MATLAB数字信号处理与应用一书相配套 资源下载 虫虫电子下载站...

function [sig,locatoms]= atoms(N,coord,display);% ATOMS Linear combination of elementary Gaussian atoms.%[SIG,LOCATOMS] = ATOMS(N,COORD,DISPLAY) %generates a signal consisting in a linear combination of elementary%gaussian wave packets. The locations of the time-frequency centers % of the different atoms are either fixed by the input parameter COORD %or successively defined by clicking with the mouse (if NARGIN==1). % %N : number of points of the signal%COORD : matrix of time-frequency centers, of the form% [t1,f1,T1,A1;...;tM,fM,TM,AM]. (ti,fi) are the % time-frequency coordinates of atom i, Ti is its time % duration and Ai its amplitude. Frequencies f1..fM should % be normalized (between 0 and 0.5). % If nargin==1, the location of the atoms will be defined% by clicking with the mouse, with the help of a menu. The % default value for Ti is N/4.% DISPLAY display switch. if DISPLAY=1 a figure is displayed,% otherwise nothing is displayed. default value is 1%SIG : output signal.%LOCATOMS : matrix of time-frequency coordinates and durations of the% atoms. %%Example : % sig=atoms(128);% sig=atoms(128,[32,0.3,32,1;56,0.15,48,1.22;102,0.41,20,0.7]); % sig=atoms(128,[32,0.3,32,1;56,0.15,48,1.22;102,0.41,20,0.7],0); %P. Flandrin, May 1995 - O. Lemoine, February 1996.%F. Auger - O. Lemoine, June 1996.% E. Chassande-Mottin, F. Auger, May 1998.%Copyright (c) 1996 by CNRS (France).%%------------------- CONFIDENTIAL PROGRAM -------------------- %This program can not be used without the authorization of its%author(s). For any comment or bug report, please send e-mail to % lemoine@alto.unice.fr if ( nargin < 1 ), error ( 'At least one parameter required' ) ;endcomp=computer; % so as to know the running computerMatlabVersion=version; MatlabVersion=str2num(MatlabVersion(1));%if MatlabVersion% error('Unfortunately, this version does not run on matlab 4.');%end;if (narginsig=(1+j)*zeros(N,1);t=linspace(0,2*pi,100); locatoms=[];Natoms=0; choice=1;T=N/4; A=1;if (display==1), clf; set(gcf,'Resize','On','NextPlot','Add'); axsig = axes('Units','normal','Visible','on','Box','On',... 'position', [0.10 0.65 0.80 0.25],... 'XLim', [1 N], 'XGrid','on', ... 'YLim', [-1 1],'YGrid','on'); axtfr = axes('Units','normal','Visible','on','Box','On',... 'position', [0.10 0.12 0.80 0.45],... 'XLim',[1 N], 'XGrid','on',... 'YLim',[0 0.5],'YGrid','on'); axes(axtfr); xlabel('Time'); ylabel('Normalized frequency'); hold onend;if (nargin==1), fprintf(' Default value for the time-duration : %f\n',T); fprintf(' Default value for the amplitude : %f\n',A); while choice~=5, MaxSig=max(abs(real(sig))); axes(axsig); plot(1:N, real(sig),'g'); if MaxSig==0.0, set(axsig,'XLim',[1 N], 'XGrid','on', 'YLim', [-1 1], 'YGrid','on'); else set(axsig,'XLim',[1 N], 'XGrid','on', 'YLim', [-MaxSig MaxSig],'YGrid','on'); end; title([int2str(Natoms),' Gaussian atom(s)']) choice=menu('ATOMS MENU',... 'Add a gaussian atom',... 'Delete the last atom',... 'Change the time-duration',... 'Change the amplitude',... 'Stop'); if choice==1, axes(axtfr); [t0,f0]=ginput(1); % add a gaussian atom t0=round(max(min(t0,N),1)); f0=max(min(f0,0.5),0.0); locatoms=[locatoms; t0 f0 T A]; axes(axtfr); plot(t0,f0,'x'); plot((t0+j*f0)+(0.5*T*cos(t)+j*(2/(T*pi))*sin(t))) sig=sig + A*amgauss(N,t0,T) .* fmconst(N,f0,t0); Natoms=Natoms+1; elseif (choice==2 & Natoms>=1), % delete last atom t0=locatoms(Natoms,1); f0=locatoms(Natoms,2); Told =locatoms(Natoms,3); Aold =locatoms(Natoms,4); axes(axtfr); AxtfrChildren=get(gca,'Children'); delete(AxtfrChildren(1:2)); if (Natoms==1) Natoms=0; locatoms=[]; sig=(1+j)*zeros(N,1); else sig=sig - Aold*amgauss(N,t0,Told) .* fmconst(N,f0,t0); Natoms=Natoms-1; locatoms=locatoms(1:Natoms,:); end; elseif choice==3, fprintf(' Old time duration : %f\n', T); Told=T; T=input(' New time duration : '); if isempty(T), T=Told; end; elseif choice==4, fprintf(' Old amplitude : %f\n', A); Aold=A; A=input(' New amplitude : '); if isempty(A), A=Aold; end; end end;elseif (nargin>=2), [Natoms,ccoord]=size(coord); if (ccoord~=4), error('Bad dimension for COORD'); end; for k=1:Natoms, t0=round(max(min(coord(k,1),N),1)); f0=max(min(coord(k,2),0.5),0.0); T=coord(k,3); A=coord(k,4); if t0~=coord(k,1), disp('Warning : ti should be between 1 and N'); elseif f0~=coord(k,2), disp('Warning : fi should be between 0 and 0.5'); elseif T error('T must be positive'); elseif A error('A must be positive'); else sig=sig+A*amgauss(N,t0,T) .* fmconst(N,f0,t0); if (display==1), axes(axtfr); plot(t0,f0,'x'); plot((t0+j*f0)+(0.5*T*cos(t)+j*(2/(T*pi))*sin(t))) end; end end locatoms=coord;endif (display==1), hold off MinSig=min(real(sig)); MaxSig=max(real(sig)); axes(axsig); plot(1:N, real(sig),'g'); if MaxSig==0.0, set(axsig,'XLim',[1 N], 'XGrid','on', 'YLim', [-1 1], 'YGrid','on'); else set(axsig,'XLim',[1 N], 'XGrid','on', 'YLim', [-MaxSig MaxSig],'YGrid','on'); end; title([int2str(Natoms),' Gaussian atom(s)'])end;

很实用的时频分析工具箱,包括短时傅里叶正反变换等,很好,很强大哦~~分享给大家,包括以下函数的源代码: % sigmerge - Add two signals with given energy ratio in dB. % % Choice of the Instantaneous Amplitude % amexpo1s - Generate one-sided exponential amplitude modulation. % amexpo2s - Generate bilateral exponential amplitude modulation. % amgauss - Generate gaussian amplitude modulation. % amrect - Generate rectangular amplitude modulation. % amtriang - Generate triangular amplitude modulation. % % Choice of the Instantaneous Frequency % fmconst - Signal with constant frequency modulation. % fmhyp - Signal with hyperbolic frequency modulation. % fmlin - Signal with linear frequency modulation. % fmodany - Signal with arbitrary frequency modulation. % fmpar - Signal with parabolic frequency modulation. % fmpower - Signal with power-law frequency modulation. % fmsin - Signal with sinusoidal frequency modulation. % gdpower - Signal with a power-law group delay. % % Choice of Particular Signals % altes - Altes signal in time domain. % anaask - Amplitude Shift Keyed (ASK) signal. % anabpsk - Binary Phase Shift Keyed (BPSK) signal. % anafsk - Frequency Shift Keyed (FSK) signal. % anapulse - Analytic projection of unit amplitude impulse signal. % anaqpsk - Quaternary Phase Shift Keyed (QPSK) signal. % anasing - Lipschitz singularity. % anastep - Analytic projection of unit step signal. % atoms - Linear combination of elementary Gaussian wave packets. % dopnoise - Generate complex Doppler random signal. % doppler - Generate complex Doppler signal. % klauder - Klauder wavelet in time domain. % mexhat - Mexican hat wavelet in time domain. % tftb_window - Window generation (previously window.m). % % Addition of Noise % noisecg - Analytic complex gaussian noise. % noisecu - Analytic complex uniform noise. % % Modification % scale - Scale signal using Mellin transform. % % % Processing Files % % Time-Domain Processing % ifestar2 - Instantaneous frequency estimation using AR2 modelisation. % instfreq - Instantaneous frequency estimation. % loctime - Time localization characteristics. % % Frequency-Domain Processing % fmt - Fast Mellin transform % ifmt - Inverse fast Mellin transform. % locfreq - Frequency localization characteristics. % sgrpdlay - Group delay estimation. % % Linear Time-Frequency Processing % tfrgabor - Gabor representation. % tfrstft - Short time Fourier transform. % % Bilinear Time-Frequency Processing in the Cohen's Class % tfrbj - Born-Jordan distribution. % tfrbud - Butterworth distribution. % tfrcw - Choi-Williams distribution. % tfrgrd - Generalized rectangular distribution. % tfrmh - Margenau-Hill distribution. % tfrmhs - Margenau-Hill-Spectrogram distribution. % tfrmmce - MMCE combination of spectrograms. % tfrpage - Page distribution. % tfrpmh - Pseudo Margenau-Hill distribution. % tfrppage - Pseudo Page distribution. % tfrpwv - Pseudo Wigner-Ville distribution. % tfrri - Rihaczek distribution. % tfrridb - Reduced interference distribution (Bessel window). % tfrridh - Reduced interference distribution (Hanning window). % tfrridn - Reduced interference distribution (binomial window). % tfrridt - Reduced interference distribution (triangular window). % tfrsp - Spectrogram. % tfrspwv - Smoothed Pseudo Wigner-Ville distribution. % tfrwv - Wigner-Ville distribution. % tfrzam - Zhao-Atlas-Marks distribution. % % Bilinear Time-Frequency Processing in the Affine Class % tfrbert - Unitary Bertrand distribution. % tfrdfla - D-Flandrin distribution. % tfrscalo - Scalogram, for Morlet or Mexican hat wavelet. % tfrspaw - Smoothed Pseudo Affine Wigner distributions. % tfrunter - Unterberger distribution, active or passive form. % % Reassigned Time-Frequency Processing % tfrrgab - Reassigned Gabor spectrogram. % tfrrmsc - Reassigned Morlet Scalogram time-frequency distribution. % tfrrpmh - Reassigned Pseudo Margenau-Hill distribution. % tfrrppag - Reassigned Pseudo Page distribution. % tfrrpwv - Reassigned Pseudo Wigner-Ville distribution. % tfrrsp - Reassigned Spectrogram. % tfrrspwv - Reassigned Smoothed Pseudo WV distribution. % % Ambiguity Functions % ambifunb - Narrow band ambiguity function. % ambifuwb - Wide band ambiguity function. % % Post-Processing or Help to the Interpretation % friedman - Instantaneous frequency density. % holder - Estimate the Holder exponent through an affine TFR. % htl - Hough transform for detection of lines in images. % margtfr - Marginals and energy of a time-frequency representation. % midscomp - Mid-point construction used in the interference diagram. % momftfr - Frequency moments of a time-frequency representation. % momttfr - Time moments of a time-frequency representation. % plotsid - Schematic interference diagram of FM signals. % renyi - Measure Renyi information. % ridges - Extraction of ridges. % tfrideal - Ideal TFR for given frequency laws. % % Visualization & backup % plotifl - Plot normalized instantaneous frequency laws. % tfrqview - Quick visualization of time-frequency representations. % tfrview - Visualization of time-frequency representations. % tfrparam - Return the paramaters needed to display (or save) a TFR. % tfrsave - Save the parameters of a time-frequency representation. % % % Other % disprog - Display progression of a loop. % divider - Find dividers of integer such that product equals integer. % dwindow - Derive a window. % integ - Approximate integral. % integ2d - Approximate 2-D integral. % izak - Inverse Zak transform. % istfr1 - returns true if a distribution is Cohen's class type 1 (spectrogram) % istfr2 - returns true if a distribution is Cohen's class type 2 (Wigner-Ville) % istfraff - returns true is a distribution is an affine class member % kaytth - Kay-Tretter filter computation. % modulo - Congruence of a vector. % movcw4at - Four atoms rotating, analyzed by the Choi-Williams distribution. % movpwdph - Influence of a phase-shift on the interferences of the pWVD. % movpwjph - Influence of a jump of phase on the interferences of the pWVD. % movsc2wv - Movie illustrating the passage from the scalogram to the WVD. % movsp2wv - Movie illustrating the passage from the spectrogram to the WVD. % movwv2at - Oscillating structure of the interferences of the WVD. % odd - Round towards nearest odd value. % sigmerge - Add two signals with given energy ratio in dB. % zak - Zak transform. % griffitc - Test signal example C of Griffiths' paper. % lambdak - Evaluate lambda function for Affine Wigner distribution. % umaxbert - Determination of the maximum value of u for Bertrand distribution. % umaxdfla - Determination of the maximum value of u for D-Flandrin distribution. % umaxunte - Determination of the maximum value of u for Unterberger distribution.
时频分析工具箱提供了计算各种线性时频表示和双线性时频分布的函数, 本帖主要列出时频分析工具箱函数简介,以号召大家就时频分析应用展开相关讨论。 一、信号产生函数: amexpo1s 单边指数幅值调制信号 amexpo2s 双边指数幅值调制信号 amgauss 高斯幅值调制信号 amrect 矩形幅值调制信号 amtriang 三角形幅值调制信号 fmconst 定频调制信号 fmhyp 双曲线频率调制信号 fmlin 线性频率调制信号 fmodany 任意频率调制信号 fmpar 抛物线频率调制信号 fmpower 幂指数频率调制信号 fmsin 正弦频率调制信号 gdpower 能量律群延迟信号 altes 时域Altes信号 anaask 幅值键移信号 anabpsk 二进制相位键移信号 anafsk 频率键移信号 anapulse 单位脉冲信号的解析投影 anaqpsk 四进制相位键移信号 anasing Lipscjitz 奇异性 anaste 单位阶跃信号的解析投影 atoms 基本高斯元的线性组合 dopnoise 复多普勒任意信号 doppler 复多普勒信号 klauder 时域Klauder小波 mexhat 时域墨西哥帽小波 二、噪声产生函数 noiseecg 解析复高斯噪声 noiseecu 解析复单位高斯噪声 tfrgabor Gabor表示 tfrstft 短时傅立叶变换 ifestar2 使用AR(2)模型的瞬时频率估计 instfreq 瞬时频率估计 sqrpdlay 群延迟估计 三、模糊函数 ambifunb 窄带模糊函数 ambifuwb 宽带模糊函数 四、Affine类双核线性时频处理函数 tfrbert 单式Bertrand分布 tfrdfla D-Flandrin分布 tfrscalo 尺度图 tfrspaw 平滑伪Affine类Wigner分布 tfrunter Unterberger分布 五、Cohen类双核线性时频处理函数 tfrbj Born-Jordan分布 tfrbud Butterworth分布 tfrcw Choi-Williams分布 tfrgrd 归一化的矩形分布 tfrmh Margenau-Hill分布 tfrmhs Margenau-Hill频谱分布 tfrmmce 谱图的最小平均互熵组合 tfrpage Page分布 tfrwv 伪Wigner-Ville分布 tfrri Rihaczek分布 tfrridb 降低交叉项的分布(Bessel窗) tfrridbn 降低交叉项的分布(二项式窗) tfrridh 降低交叉项的分布(汉宁窗) tfrridt 降低交叉项的分布(三角窗) tfrsp 谱图分布 tfrspwv 平滑伪Wigner-Ville分布 tfrwv Wigner-Ville分布 tfrzam Zhao-Atlas-Marks分布 六、其他处理函数: friedman 瞬时频率密度 htl 图像直线检测的Hough变换 margtfr 时频表示的能量 momftfr 时频表示的频率矩 momttfr 时频表示的时间矩 renyi Renyi信息度量 ridges 波峰提取 plotifl 绘制归一化的瞬时频率规律 tfrparam 返回用于显示时频表示的参数 tfrqview 时频表示的快速可视化 tfrsave 保存时频表示的参数 tfrview 时频表示的可视化
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值