一、获取代码方式

获取代码方式1:
完整代码已上传我的资源:【物理应用】基于matlab波数谱计算【含Matlab源码 508期】

获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、部分源代码

clear
figure
load tide36part16RSPO
%load tide36allload all_atm_pres.mat
a=mean(atmp');
pa=(a-mean(a))'/100;
t=[166.5:0.5:901.5]';
%t=t(2:2:1472);
%pa=interp1(t,pa,onetime1n);
tidem1d5B=interp1(time36part,tide36part,t);
tidem=tidem1d5B;tidem1d5pa=tidem+pa(2:1:1472);load uriba5
ba=interp1(onetime,BA5,t);aa=tidem1d5pa+ba;
st=isnan(aa);
ba(st)=[];
tidem1d5pa(st)=[];
t(st)=[];in=ba;order=4;filtT=[70];sampT=1/2;
%hold off
%plot(ba);hold on;plot(ba-ba70','r')filtT=[70 2];
filtT=[70];%ba70n=butterfilthigh(in, order,70,sampT)*100;
%ba70=butterfiltbandpass(in, order,filtT,sampT)*100;
ba70=butterfilthigh(in, order,filtT,sampT)*100;%plot(ba70,'g')
%plot(ba);hold on;plot(ba-ba70','r')
in=tidem1d5pa;
%tide70=butterfiltbandpass(in, order,filtT,sampT)*100;
tide70=butterfilthigh(in, order,filtT,sampT)*100;nFFT=128*2;
Fs=2;
WinLength=nFFT;
nOverlap=WinLength/2;
Window=hanning(WinLength); %Window=(WinLength);
%Window=WinLength;
Detrend='linear';P=0.90;subplot(2,2,3);hold offecp2=ba70;
[psd_bp1,pconf,f]=psd(ecp2,nFFT,Fs,Window,nOverlap,P);
semilogx(f,psd_bp1.*f,'k');
xlim([0.01 1])xlabel('cycles/day');hold on
ylabel('cm^2');hold onecp2=tide70;
[psd_bp1,pconf,f]=psd(ecp2,nFFT,Fs,Window,nOverlap,P);
semilogx(f,psd_bp1.*f,'r','color',[0.5 0.5 0.5]);
xlabel('cycles/day');
title('Variance preserving PSD')%NW=fix(736/64*2); x=tide70;y=tide70;qbias=[];confn=[];qplot=1; dt=1;
%[s, c, ph, ci, phi] = cmtm(x,y,dt,NW,qbias,confn,qplot);ci(1)%h=legend ('Tide station','Bottom pressure');
%h1=findobj(h,'type','text')
%set(h1(1),'color',[0.5 0.5 0.5])
%set(h1(2),'color',[0 0 0])subplot(4,2,6)
[ Pxx, Pyy, Pxy, coh, pha, freq ] = func_coherence((ba70),(tide70), nFFT, Fs, nFFT, nOverlap );f=freq;
semilogx(f,coh,'k');hold on
%plot(f,ones(65,1)*0.3730,'k')
plot(f,ones(129,1)*0.3730,'k')
function [out]=butterfilt(in,order,filtT,sampT);
%
% function [out]=butterfilt(in,order,filtT,sampT);
%
% This function is designed to do lowpass filtering of any vector of
% data.  It uses a  Butterworth filter and does the
% filtering twice, once forward and once in the reverse direction.
%
% INPUTS:
%        in    -- the data vector
%    filtT -- the smoothing period;
%    sampT -- the sample period
%        order -- of the butterworth filter
%
%  NOTE:  filtT and sampT must be entered in the same units!!!!!
%[mm,nn]=size(in);
if nn>mm & mm==1in=in';[mm,nn]=size(in);
elseif mm~=1 & nn~=1error('Input must be a vector and not an array!!!')
end%
% First remove a ramp so that the first and last points are zero.
% This minimizes the filter transients at the ends of the record.
%
P=polyfit([1 mm],[in(1) in(mm)],1);
dumx=[1:mm]';
lineartrend=polyval(P,dumx)*0;
in=in-lineartrend;%
% Second, create the Butterworth filter.
%
Wn=(2./filtT)*sampT;
[b,a]=butter(order,Wn,'high');%
% Third, filter the data both forward and reverse.
%
inan=find(isnan(in));
if ~isempty(inan)error('There are NaNs in the data set!!! Remove them and try again!')
end
out=filtfilt(b,a,in);
%

三、运行结果


四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 门云阁.MATLAB物理计算与可视化[M].清华大学出版社,2013.

【物理应用】基于matlab波数谱计算【含Matlab源码 508期】相关推荐

  1. 【Matlab生物电信号】生物电信号仿真【含GUI源码 684期】

    一.代码运行视频(哔哩哔哩) [Matlab生物电信号]生物电信号仿真[含GUI源码 684期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]董兵,超于毅,李 ...

  2. 【Matlab语音分析】语音信号分析【含GUI源码 1718期】

    一.代码运行视频(哔哩哔哩) [Matlab语音分析]语音信号分析[含GUI源码 1718期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]韩纪庆,张磊,郑铁 ...

  3. 【Matlab验证码识别】遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别【含GUI源码 1694期】

    一.代码运行视频(哔哩哔哩) [Matlab验证码识别]遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别[含GUI源码 1694期] 二.matlab版本及参考文献 1 matlab ...

  4. 【Matlab人脸识别】BP神经网络人脸识别(含识别率)【含GUI源码 891期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]BP神经网络人脸识别(含识别率)[含GUI源码 891期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] ...

  5. 【Matlab人脸识别】形态学教室人数统计(带面板)【含GUI源码 1703期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]形态学教室人数统计(带面板)[含GUI源码 1703期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]孟 ...

  6. 【Matlab人脸识别】人脸实时检测与跟踪【含GUI源码 673期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]人脸实时检测与跟踪[含GUI源码 673期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]孟逸凡,柳益君 ...

  7. 【Matlab图像融合】小波变换遥感图像融合【含GUI源码 744期】

    一.代码运行视频(哔哩哔哩) [Matlab图像融合]小波变换遥感图像融合[含GUI源码 744期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 包子阳,余 ...

  8. 【Matlab语音加密】语音信号加密解密(带面板)【含GUI源码 181期】

    一.代码运行视频(哔哩哔哩) [Matlab语音加密]语音信号加密解密(带面板)[含GUI源码 181期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]韩纪庆 ...

  9. 【Matlab身份证识别】身份证号码识别【含GUI源码 014期】

    一.代码运行视频(哔哩哔哩) [Matlab身份证识别]身份证号码识别[含GUI源码 014期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MAT ...

  10. 【Matlab人脸识别】KL变换人脸识别【含GUI源码 859期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]KL变换人脸识别[含GUI源码 859期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MAT ...

最新文章

  1. oracle导入备份失败怎么办,ORACLE 数据备份、恢复以及导入时表空间不存在的解决方案...
  2. 强类型语言和静态类型语言有什么区别?
  3. php 无限查找下级业绩_php如何查找会员无限分类的所有上级和所有下级
  4. mongodb分片介绍—— 基于范围(数值型)的分片 或者 基于哈希的分片
  5. oracle没有groupby,oraclegroupby之后还可以groupby么
  6. shell预定义变量
  7. JZOJ 6030. 【GDOI2019模拟2019.2.25】白白的
  8. python 处理xml pandas_Python数据处理分析,解决pandas中所有的Excel疑难杂症(上)
  9. 拦截器---SpringMVC学习笔记(十四)
  10. python 命名空间报错_python命名空间与作用域
  11. ZedGraph属性(转)
  12. 更改Mysql 密码的4种方法(转)
  13. Android 自定义progressDialog实现
  14. VSNETcodePrint 2005 SQL ServerPrint 2005
  15. 登录,注册,个人信息,退出的隐藏和出现
  16. Linux查看磁盘是否被占满,怎么查看Linux磁盘空间是否满了?
  17. 登陆csdn卡死机,进入不了csdn内容管理页面终极解决方案
  18. oracle数据库常用操作语句大全,Oracle 数据库常用操作语句大全
  19. 通过一个大型项目来学习分布式算法(3)
  20. 女程序员开发软件挂专家号,转手获利被刑拘

热门文章

  1. JavaWeb案例(MVC+MySQL+分页功能)+前后端分离
  2. jq的attr、prop和data区别
  3. CentOS下双网卡绑定-bond0
  4. [转] Java之ACM速成
  5. MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]
  6. hdu 2795 Billboard
  7. C++ Lib的生成与调用 生成dll,lib快速的寻找方法
  8. 黑马程序员 Python学习笔记之PyCharm 的初始设置
  9. Unity整体与单个缩放比例
  10. 扇贝有道180628每日一句