peak

FFT - Calculating exact frequency between frequency bins

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a nice FFT library I found online to see if I can write a pitch-detection program. So far, I have been able to successfully let the library do FFT calculation on a test audio signal containing a few sine waves including one at 440Hz (I'm using 16384 samples as the size and the sample rate at 44100Hz). The FFT output looks like: 433.356Hz - Real: 590.644 - Imag: -27.9856 - MAG: 16529.5 436.047Hz - Real: 683.921 - Imag: 51.2798 - MAG: 35071.4 438.739Hz - Real: 4615.24 - Imag: 1170.8 - MAG: 5.40352e+006 441.431Hz - Real: -3861.97 -

Efficient way to find the max number in an array

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is an interview question There is an array of integers. The elements in the array can follow the following patterns. numbers are in ascending order numbers are in descending order numbers increases in the beginning and decreases in the end numbers decreases in the beginning and increases in the end What is the efficient way to find the max number in the array? 回答1: In that case, all you need to do is to determine whether it's (3). If not, the answer is max(first, last). In the case that all elements are equal, you'll need to

In Matlab, how to draw lines from the curve to specific xaxis position?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a spectral data (1000 variables on xaxis, and peak intensities as y) and a list of peaks of interest at various specific x locations (a matrix called Peak) which I obtained from a function I made. Here, I would like to draw a line from the maximum value of each peaks to the xaxis - or, eventually, place a vertical arrow above each peaks but I read it is quite troublesome, so just a vertical line is welcome. However, using the following code, I get "Error using line Value must be a vector of numeric type". Any thoughts? X = spectra;

Peak-finding algorithm for Python/SciPy

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I can write something myself by finding zero-crossings of the first derivative or something, but it seems like a common-enough function to be included in standard libraries. Anyone know of one? My particular application is a 2D array, but usually it would be used for finding peaks in FFTs, etc. Specifically, in these kinds of problems, there are multiple strong peaks, and then lots of smaller "peaks" that are just caused by noise that should be ignored. These are just examples; not my actual data: 1-dimensional peaks: 2-dimensional

How to get frequency from fft result?

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have recorded an array[1024] of data from my mic on my Android phone, passed it through a 1D forward DFT of the real data (setting a further 1024 bits to 0). I saved the array to a text file, and repeated this 8 times. I got back 16384 results. I opened the text file in Excel and made a graph to see what it looked like(x=index of array, y=size of number returned). There are some massive spikes (both positive and negative) in magnitude around 110, 232, and small spikes continuing in that fashion until around 1817 and 1941 where the spikes

Peak meters for individual programs on Windows 7

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is it possible to obtain the peak meter readings for individual programs on Windows 7, and if so, how? With WASAPI one can capture the entire system audio through a loopback device, but this does not differentiate between outputs from different programs. This question regards capturing audio for a single specified application, but the answers seem prohibitive when dealing with capturing all programs that are playing audio individually. This must be possible because SndVol can do it, as shown in the image below. The question is how

Start, End and Duration of Maximum Drawdown in Python

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Given a time series, I want to calculate the maximum drawdown, and I also want to locate the beginning and end points of the maximum drawdown so I can calculate the duration. I want to mark the beginning and end of the drawdown on a plot of the timeseries like this: a busy cat http://oi61.tinypic.com/r9h4er.jpg So far I've got code to generate a random time series, and I've got code to calculate the max drawdown. If anyone knows how to identify the places where the drawdown begins and ends, I'd really appreciate it! import pandas

Peak finding algorithm

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently started looking at MIT's 6.006 lectures and in the first lecture the instructor presented peak-finding algorithm. http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/MIT6_006F11_lec01.pdf According to his definitions: Given an array [a,b,c,d,e,f,g] where a-g are numbers, b is a peak if and only if a = c. He gave a recursive approach: if a[n/2] He said the algorithm is T(n) = T(n/2) + o(1) = o(lgn) In his pdf he also gave a complete example: [6,7,4,3,2,1,4

POJ 1006 Biorhythms

匿名 (未验证) 提交于 2019-12-02 23:32:01
https://cn.vjudge.net/problem/POJ-1006 题目 Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they have periods of lengths 23, 28, and 33 days, respectively. There is one peak in each period of a cycle. At the peak of a cycle, a person performs at his or her best in the corresponding field (physical, emotional or mental). For example, if it is the mental curve, thought processes will be sharper and concentration will be easier. Since the three cycles have different

[LeetCode]Find Peak Element

本小妞迷上赌 提交于 2019-12-02 11:08:19
二分查找推荐博文 你真的会二分查找吗? http://blog.csdn.net/int64ago/article/details/7425727 解题思路: 比较数组中间两个 数的大小,然后向数较大的那半边数组去寻找peak 前条件:left 指向区间最左边,right指向区间最右边的下一个; 不变式:mid = (left + right) >> 1; 结束条件:mid == left, 这说明,该区间,只有一个元素,也就是我们要找的peak 边界条件:如果硬要说边界条件,那么nums.size() == 0算是一个。 方法一: 时间复杂度为O(n)的方法 class Solution { public: int findPeakElement(vector<int>& nums) { if (nums.size() <= 0) return -1; int peakIndex = 0; int i = 0; for (; i < nums.size(); ++i){ if (i-1 < 0) continue; if (nums[i] < nums[i-1]) break; } peakIndex = i -1; return peakIndex; } }; 方法二: 时间复杂度为O(logn)的方法 二分查找的 递归实现( 8ms ) 思路:利用中间 mid 和 mid