frequency-analysis

How do I run a high pass or low pass filter on data points in R?

China☆狼群 提交于 2019-12-17 21:43:33
问题 I am a beginner in R and I have tried to find information about the following without finding anything. The green graph in the picture is composed by the red and yellow graphs. But let's say that I only have the data points of something like the green graph. How do I extract the low/high frequencies (i.e. approximately the red/yellow graphs) using a low pass/high pass filter? Update: The graph was generated with number_of_cycles = 2 max_y = 40 x = 1:500 a = number_of_cycles * 2*pi/length(x) y

Is this Fourier Analysis of Luminance Signals Correct? (Android)

回眸只為那壹抹淺笑 提交于 2019-12-13 08:40:59
问题 I'm writing an Android app that measures the luminance of camera frames over a period of time and calculates a heart beat using Fourier Analysis to find the wave's frequency. The problem is that my spectral analysis looks like this: which is pretty much the inverse of what a spectral analysis should look like (like a normal distribution). Can I accurately assess this to find the index of the maximum magnitude, or does this spectrum reveal that my data is too noisy? EDIT: Here's what my camera

Android - demod FSK using goertzel

好久不见. 提交于 2019-12-12 03:59:04
问题 I am using this code https://stackoverflow.com/questions/23432398/audio-recorder-in-android-process-the-audio-bytes to capture the mic audio but I am writing the data to a ByteArrayOutputStream. After I finish the record I want to demodule the signal captured by using Goertzel Algorithm. The FSK signal consists out of 2 frequencies, 800Hz for '1' and 400Hz for '0' each bit is moduled using 100 samples. I am using this class of Goertzel: http://courses.cs.washington.edu/courses/cse477

How to use inverse FFT on amplitude-frequency response?

限于喜欢 提交于 2019-12-10 20:12:26
问题 I am trying to create an application for calculating coefficients for a graphic equalizer FIR filter. I am doing some prototyping in Matlab but I have some problems. I have started with the following Matlab code: % binamps vector holds 2^13 = 8192 bins of desired amplitude values for frequencies in range 0.001 .. 22050 Hz (half of samplerate 44100 Hz) % it looks just fine, when I use Matlab plot() function % now I get ifft n = size(binamps,1); iff = ifft(binamps, n); coeffs = real(iff); %

Awk: Characters-frequency from one text file?

戏子无情 提交于 2019-12-09 23:44:08
问题 Given a multilangual .txt files such as: But where is Esope the holly Bastard But where is 생 지 옥 이 군 지 옥 이 지 옥 지 我 是 你 的 爸 爸 ! 爸 爸 ! ! ! 你 不 會 的 ! I counted space-separated words' word-frequency using this Awk function : $ awk '{a[$1]++}END{for(k in a)print a[k],k}' RS=" |\n" myfile.txt | sort Getting the elegant : 1 생 1 군 1 Bastard 1 Esope 1 holly 1 the 1 不 1 我 1 是 1 會 2 이 2 But 2 is 2 where 2 你 2 的 3 옥 4 지 4 爸 5 ! How to change it to count characters-frequency ? EDIT: For Characters

R Frequency Table of Likert Data

孤者浪人 提交于 2019-12-07 18:37:09
问题 I have what I thought was a basic task, but has proven otherwise. I have a series of surveys that I need to convert into frequency tables for each survey. For instance, Survey 1 consists of 6 questions in which participants had 5 response options. For each survey, I need to produce a table that has each question (in this example there are 6), along with the percentage of participants who responded with each response option per question. I have been using prop.table but have only been able to

R Frequency Table of Likert Data

人走茶凉 提交于 2019-12-06 09:01:16
I have what I thought was a basic task, but has proven otherwise. I have a series of surveys that I need to convert into frequency tables for each survey. For instance, Survey 1 consists of 6 questions in which participants had 5 response options. For each survey, I need to produce a table that has each question (in this example there are 6), along with the percentage of participants who responded with each response option per question. I have been using prop.table but have only been able to do that for a single question at a time and I haven't figured out how to add a percentage sign, and I

How can I transfer a discrete set of data into the frequency domain and back (preferrably losslessly)

拟墨画扇 提交于 2019-12-05 10:15:15
问题 I would like to take an array of bytes of roughly size 70-80k and transform them from the time domain to the frequency domain (probably using a DFT). I have been following wiki and gotten this code so far. for (int k = 0; k < windows.length; k++) { double imag = 0.0; double real = 0.0; for (int n = 0; n < data.length; n++) { double val = (data[n]) * Math.exp(-2.0 * Math.PI * n * k / data.length) / 128; imag += Math.cos(val); real += Math.sin(val); } windows[k] = Math.sqrt(imag * imag + real *

Matlab: Finding dominant frequencies in a frame of audio data

痞子三分冷 提交于 2019-12-05 05:21:43
问题 I am pretty new to Matlab and I am trying to write a simple frequency based speech detection algorithm. The end goal is to run the script on a wav file, and have it output start/end times for each speech segment. If use the code: fr = 128; [ audio, fs, nbits ] = wavread(audioPath); spectrogram(audio,fr,120,fr,fs,'yaxis') I get a useful frequency intensity vs. time graph like this: By looking at it, it is very easy to see when speech occurs. I could write an algorithm to automate the detection

Awk: Characters-frequency from one text file?

穿精又带淫゛_ 提交于 2019-12-04 18:14:54
Given a multilangual .txt files such as: But where is Esope the holly Bastard But where is 생 지 옥 이 군 지 옥 이 지 옥 지 我 是 你 的 爸 爸 ! 爸 爸 ! ! ! 你 不 會 的 ! I counted space-separated words' word-frequency using this Awk function : $ awk '{a[$1]++}END{for(k in a)print a[k],k}' RS=" |\n" myfile.txt | sort Getting the elegant : 1 생 1 군 1 Bastard 1 Esope 1 holly 1 the 1 不 1 我 1 是 1 會 2 이 2 But 2 is 2 where 2 你 2 的 3 옥 4 지 4 爸 5 ! How to change it to count characters-frequency ? EDIT: For Characters-frequency, I used (@Sudo_O's answer): $ grep -o '\S' myfile.txt | awk '{a[$1]++}END{for(k in a)print a[k],k}'