《量化投资:以MATLAB为工具》

MATLAB技术论坛

 找回密码
 注册账号
查看: 3746|回复: 5
收起左侧

[感谢] 谢谢pzfs1016的热心帮助,已完成啦~~

[复制链接]
发表于 2012-3-29 20:51:34 | 显示全部楼层 |阅读模式
{:soso_e163:} 谢谢pzfs1016的热心帮助~~

date.TXT

125.6 KB, 下载次数: 142

发表于 2012-3-29 22:00:33 | 显示全部楼层
基本为正弦波,频率0.75Hz,幅值0.01676
求解程序:
  1. load date.txt
  2.   figure
  3. plot( date(:,1),date(:,2) )
  4. figure
  5. DFT(date(:,2)-mean( date(:,2) ),0.01);
复制代码
下面是自定义DFT文件,幅值并存成DFT.m文件
  1. function [f,X_m,X_fai]=DFT(xn,ts,N)
  2. % [f,X_m,X_fai]=DFT(xn,ts)
  3. % 离散序列的傅里叶变换 出图
  4. % 输入  xn为离散序列 为向量  ts为序列的采样时间/s
  5. % 输出 f为频率向量,X_m为幅值向量,X_fai为相位向量
  6. % 注意计算出来的0频分量(直流分量应该除以2)  直流分量的符号应结合相位图来确定

  7. if nargin==2
  8.     N=length(xn);
  9. end

  10. Xk=fft(xn,N);
  11. fs=1/ts;               %采样频率 HZ
  12. X_m=abs(Xk)*2/N;        %幅值
  13. X_fai=angle(Xk);      %相位
  14. Nn=floor((N-1)/2);    %变换后有用的点数-1
  15. f=(0:Nn)*fs/N ;       %横坐标 频率HZ
  16. X_m=X_m(1:Nn+1);      %幅值(仅取有用点Nn个点)
  17. X_fai=X_fai(1:Nn+1);  %相位(仅取有用点Nn个点)
  18. X_fai=unwrap(X_fai);   %去除相位的间断点(仅在出图时作用)
  19. X_fai=X_fai*180/pi;   %化成°单位

  20. if nargout==0
  21.     plot(f,X_m)
  22.     title('DFT的幅值-频率图');
  23.     xlabel('频率/HZ');ylabel('幅值');
  24.     grid on

  25.     figure,plot(f,X_fai)
  26.     title('DFT的幅值-相位图');
  27.     xlabel('频率/HZ');ylabel('相位/°');
  28.     grid on
  29. end

  30. %自编-------unwrap-------未用-----------------------
  31. function fai=convert_fai(fai)
  32. n=length(fai);
  33. for ii=3:n
  34.     while fai(ii)-fai(ii-1)>=170
  35.         fai(ii)=fai(ii)-180;
  36.     end
  37.     while fai(ii)-fai(ii-1)<=-170
  38.         fai(ii)=fai(ii)+180;
  39.     end
  40. end
复制代码
 楼主| 发表于 2012-3-30 11:18:16 | 显示全部楼层
图片请见下边~~
更多图片 小图 大图
组图打开中,请稍候......
发表于 2012-12-1 22:33:52 | 显示全部楼层
请问有无关于增量谐波法的程序啊
发表于 2013-2-26 13:29:28 | 显示全部楼层
garuda83 发表于 2012-3-30 11:18
图片请见下边~~

这是在计算什么
发表于 2018-6-30 01:22:46 | 显示全部楼层

Anthony Steen Dolphins Jersey

"And all you need is one (criminal) act within the last five years to reach back and say, 'The same group of doctors and trainers were there and' ... if you have enough of them doing the same thing in different locker rooms, well, it's hard to defend as a one-off,Cheap Nike Arizona Cardinals Jerseys Free Shipping," he added.
Romberg, 34, had three stints inserted during heart surgery just a year after retiring,Alexis Sanchez Arsenal Jersey UK, and said his doctors asked how the team never noticed the heart problems during physicals.
Patrick Cobbs, who joined New England in 2006 as an undrafted free agent and then caught on as running back in Miami through 2010, said he started taking painkillers to deal with hip and rib injuries in 2007-08.
Roscoe Parrish played wide receiver in Buffalo from 2005-11, then on the practice squads in San Diego, Oakland and Tampa Bay, in 2012.
"It could be an anomaly,Anthony Steen Dolphins Jersey," Romberg said, "and I don't know if there's any correlation. But a lot of pills I took, I look at the warning labels now and a few of them say 'if you have heart issues, don't take them.'"
Romberg described the Jaguars as "very liberal" in doling out painkillers and called the Rams' training room a "huge free-for-all." He said there were some changes in the clubhouse between his two seasons in Atlanta.
The NFL is not aware of "any DEA subpoenas or investigations into club practices," spokesman Greg Aiello wrote in an email Friday. "There has been a league-wide reporting system in place (to track controlled substances and prescriptions issued by team doctors) since 1973 for compliance with DEA and state law requirements."
The DEA declined comment, citing the agency's policy against discussing potential investigations. But law enforcement sources, speaking on condition of anonymity because they were not authorized to speak publicly, confirmed that the agency was looking into allegations in the lawsuit.
"It seemed like the norm then. Now, you know what that's done to you and it seems so wrong," Cobbs said.
Dozens of former players joining a lawsuit against the NFL say teams kept handing out powerful painkillers and other drugs with few — if any— safeguards as recently as 2012. That extends by four years the time frame for similar claims made in the original complaint and could open the door to a criminal investigation.
"I never saw a bottle. They were always in envelopes,Bobby Doerr Jersey," Parrish said. "I got accustomed to (Buffalo trainer) Bud Carpenter giving me painkillers and didn't educate myself. All I cared about was playing."
"Then it's no longer just about money. Then it's potentially about criminal conduct and that's a completely different ballpark," said Steven Feldman, a former assistant U.S. Attorney for New York's southern district.
The former players in the painkillers lawsuit have reported a range of debilitating effects, from chronic muscle and bone ailments to permanent nerve and organ damage to addiction. The players contend those health problems came from drug use, but many of the conditions haven't been definitively linked to painkillers.
Lead plaintiffs' attorney Steve Silverman said this week that 500 more players have since joined the lawsuit,Chile Jersey, which is seeking class certification. The latest group includes dozens who played in the NFL between 2009 and 2012 and told lawyers in interviews that little had changed about how some teams handled the drugs. The Associated Press interviewed three of those players.

"I had knee problems in 2010, so I started getting, I'm not sure, I think they were Vicodins, in a small white envelope. I played that game without pain, so it became routine," he said.
With the federal Drug Enforcement Administration beginning to look into accusations contained in the lawsuit — filed in May and covering the years 1968-2008 — the new allegations could dramatically expand the investigation's scope, legal experts said. Any violation of federal drug laws after 2009 would not be subject to the five-year statute of limitations.
Six of the plaintiffs in the painkillers lawsuit, including McMahon and Van Horne, were also parties to the concussion-related class-action lawsuit last year against the NFL. A federal judge granted preliminary approval to a settlement nearly two weeks ago
The Bills declined a request to speak to Carpenter, but said in an email response: "Bud Carpenter strongly disagrees with Roscoe Parrish's accusation."
It contends the NFL and its teams, physicians and trainers acted without regard for players' health, withholding information about injuries while routinely — and often illegally — providing them with prescription painkillers such as Vicodin and Percocet, and anti-inflammatories such as Toradol, to mask pain and minimize lost playing time.
The lawsuit on behalf of 500 former players was filed in U.S. District Court in northern California and amended two weeks later to add another 250. The nine named plaintiffs include current ESPN analyst Marcellus Wiley, Chicago Bears quarterback Jim McMahon and Hall of Fame defensive lineman Richard Dent.
"On flights home, the routine was the same everywhere," said Brett Romberg, who played center in Jacksonville (2003-05), St. Louis (2006-08) and Atlanta (2009 and 2011). "The trainers walked up and down the aisle and you'd hold up your hand with a number of fingers to show how many pills you wanted. No discussions, no questions. You just take what they hand you and believe me, you'll take anything to dull the pain."
"In 2011, you had to see the doctor first. ... You'd still get your Molotov cocktail,Gordon Hayward Jersey, but they were tighter about documenting it," Romberg said.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|网站地图|MATLAB技术论坛|Simulink仿真论坛 ( 蜀ICP备19014457号-2 

GMT+8, 2022-12-4 12:43 , Processed in 0.065584 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表