自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 智能信息处理(2)

傅里叶变换为什么需要将信号从时域变换到频域去分析信号? (1)使复杂计算简单化 如用对数变换可以使乘、除变为加、减,用拉普拉斯变换可将微分方程变为代数方程;(2)便于特征提取 如经傅立叶变换可知道信号是集中在低频还是高频部分。使的一些在时域中无明显特征的信号,在频域里很容易出现明显的特征。 (3)可使数据压缩 如一信号由基波和50次谐波组成,按采样定理,在时域中表示信号的一个周期至少需要100个采样点。而在频域中,它仅为两个正旋波,每个用其幅值、频...

2020-12-05 20:13:43 466

原创 功率谱估计

对于随机信号,不存在傅里叶变换,其对应的功率谱估计方法主要包括非参数方法(包括韦尔奇)和参数方法(ARMA, Burg)。周期图方法fs = 1000;t = 0:1/fs:1;xn = sin(2*pi*80*t) + 2*sin(2*pi*140*t) + randn(size(t));N = length(xn);y = abs(fft(xn,1024));Pxx = y.^2/N;f = [0:N-1]*fs/N;plot(f(1:N/2+1),Pxx(1:N/2+1));

2020-12-05 20:13:41 2757 2

原创 智能信息处理(1)

信号时域处理包括的主要内容 相干平均算法 相干平均主要应用于能多次重复的信号的提取。如果待检测的医学信号与噪声重叠在一起,信号如果可以重复出现,而噪声是随机信号,可用叠加法提高信噪比,从而提取有用的信号。效果估计:其中为含有噪声的待检测信号,为重复出现的有用信号,为随机噪声。经过N次叠加求平均,则:.若信号的功率为P,噪声的方差为,那么对每一个,其功率比为.经N次平均后,噪声的方差变为,所以平均后信号的功率比为,提高了N倍。其matlab代码如下:clcclea...

2020-12-05 11:14:53 2221 1

原创 315. 计算右侧小于当前元素的个数 python

利用二叉搜索树class Tree: def __init__(self, val): self.val = val self.left = None self.right = None self.num = 1class Solution: def countSmaller(self, nums): ...

2018-05-21 17:17:38 768

原创 [LeetCode] 223. Rectangle Area

class Solution: def computeArea(self, A, B, C, D, E, F, G, H): """ :type A: int :type B: int :type C: int :type D: int :type E: int :type F:...

2018-05-17 19:26:19 101

原创 LeetCode 42. Trapping Rain Water (python)

class Solution(object): def trap(self, height): """ :type height: List[int] :rtype: int """ cache = []            #保存凸出来的柱子 area = 0 if len(...

2018-05-03 21:43:44 237

转载 Leetcode 813. Largest Sum of Averages

转载自https://blog.csdn.net/birdreamer/article/details/79850052class Solution: def largestSumOfAverages(self, A, K): """ :type A: List[int] :type K: int :rtype: float...

2018-04-28 23:24:25 240

转载 815. Bus Routes

参考https://blog.csdn.net/zjucor/article/details/79850104在他代码基础上,添加了一些个人的理解from collections import defaultdict class Solution: def numBusesToDestination(self, routes, S, T): """ ...

2018-04-28 21:56:58 305

原创 817. Linked List Components

标定匹配list和对应的链表,首先可以把链表转化为线性表,考虑到Python的dict自带排序效果,引入有序字典OrderedDict,标记字典中已经在G中出现过的为1,未出现过的标记为0.from collections import OrderedDictclass Solution: def numComponents(self, head, G): """ ...

2018-04-28 18:45:31 211

转载 818. race car

参考链接:https://www.cnblogs.com/qisfj/p/leecode818.html采用动态规划方法解题,设dp[t]表示target为t时,最少需要的步数。将连续的n次A操作改变的position记为nA,很显然,+iA-jA+kA等价于+kA-jA+iA,同时+iA+kA等价于+kA+iA。所以当存在一串操作使position始终没有超过t,那么可以首先尽量尝试达到posi...

2018-04-25 20:28:48 253

原创 1020. Tree Traversals

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<functional>#include<set>#include<queue>using namespace std;stru...

2018-03-12 20:59:48 141

原创 1014. Waiting in Line

#define _CRT_SECURE_NO_WARNINGS#include<iostream> #include<vector>#include<algorithm>#include<functional>#include<queue>#include<deque>#include<string>

2018-03-09 10:50:39 124

原创 1012. The Best Rank

#define _CRT_SECURE_NO_WARNINGS#include<iostream> #include<vector> #include<set> #include<map> #include<queue> #include<algorithm>#include<functional...

2018-03-08 19:28:46 255

原创 1010. Radix

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<functional>#include<string>using namespace std;long long compute(strin...

2018-03-08 17:11:23 145

原创 1009. Product of Polynomials

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<map>#include<algorithm>#include<functional>using namespace std;struct item { int index;...

2018-03-08 15:17:19 194

原创 1008. Elevator

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>using namespace std;#define TimeUp 6#define TimeDown 4#define TimeStay 5int main() { freopen("D://...

2018-03-08 14:49:36 120

原创 1007. Maximum Subsequence Sum

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;int main() { freopen("D://input.txt", "r", stdin)...

2018-03-08 11:03:02 109

原创 1006. Sign In and Sign Out

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;struct person { string name; string arrive; str...

2018-03-08 09:57:58 181

原创 1004. Counting Leaves

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>#include<queue>#define MAX 100using namespace std;struct node ...

2018-03-08 09:27:23 141

原创 1003. Emergency

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>#define MAX 500#define INF 99999using namespace std;int sumLength, ...

2018-03-07 21:49:49 109

原创 1002. A+B for Polynomials

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;struct item { int index; double number; item(int _index,...

2018-03-07 20:51:53 108

原创 1001. A+B Format (20)

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<vector>#include<algorithm>#include<string>using namespace std;int main() { freopen("D://input.txt", "r", stdin)...

2018-03-07 20:23:34 119

原创 最长回文子序列

算法导论思考题15-2回文是正序与逆序相同的非空字符串。例如,所有长度为1的字符串,civic,racecar,aibohphobia都是回文,设计算法,求给定输入字符串的最长回文子序列。例如,给定输入character,算法应该返回carac,算法的运行时间是怎样的?    这是一个动态规划题目,注意到一个长度为n的字符串L(0,n)有以下三种情况:    1、首尾字符相同,其最大子串的长度l(...

2018-03-05 18:54:56 516

原创 局部变量,全局变量在内存中的区别

变量的存储类型是指存储变量值的内存类型。变量的存储类型决定变量何时创建、何时销毁以及它的值将保持多久。有三个地方可以用于存储变量:普通内存、运行时堆栈、硬件寄存器。在这三个地方存储的变量分别具有不同的特性。  变量的缺省存储类型取决于他的声明位置。凡是在任何代码块之外声明的变量总是存储于静态内存中,也就是不属于堆栈的内存,这类变量称为静态变量。对于这类变量,你无法为他们指定其他存储类型。静态变

2018-02-06 17:06:44 438

原创 1068. Find More Coins (30)

#define _CRT_SECURE_NO_WARNINGS#include#include#include#includestruct coins {int value;bool visited;coins(int _value = 0, bool _visited = false) :value(_value), visited(_visited) {};

2018-01-11 16:34:27 111

转载 c++中的string常用函数用法总结

转自:http://www.jb51.net/article/41725.htm标准c++中string类函数介绍注意不是CString之所以抛弃char*的字符串而选用C++标准程序库中的string类,是因为他和前者比较起来,不必 担心内存是否足够、字符串长度等等,而且作为一个类出现,他集成的操作函数足以完成我们大多数情况下(甚至是100%)的需要。我们可以用 = 进行赋值

2018-01-07 19:47:46 129

转载 binary_function函数用法

转自:http://blog.csdn.net/mydriverc2/article/details/11554345大多数情况,不需要用到binary_function! 如果你在定义一个二元的functor时,几乎可以不用管这个binary_function。但是如果你使用一些function adapter的时候就需要了,这其实是在实现一种concept. 比如,定义

2018-01-07 18:28:16 4742

转载 cin.clear() 、cin.sync()和cin.ignor()的用法

一、cin.clear()、cin.sync()    cin.clear()是用来更改cin的状态标示符的。    cin.sync()是用来清除缓存区的数据流的。如果标示符没有改变那么即使清除了数据流也无法输入。所以两个要联合起来使用。例如:#includeusing namespace std;int main(){ int a; cout

2018-01-06 19:16:57 981

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除