fft

Power spectral density of FFT

落花浮王杯 提交于 2019-12-22 18:30:54
问题 I have a piece of code that gets the FFT of a part of the signal and I'm now trying to get the PSD, Fs = 44100; cj = sqrt(-1); %T=.6; dt = 1/Fs; left=test(:,1); right=test(:,2); time = 45; interval =.636; w_range = time*Fs: (time+interval)*Fs-1; I = left(w_range); Q = right(w_range); n = interval * Fs; f = -Fs/2:Fs/n:Fs/2-Fs/n; s = I+cj.*Q; % Smooth the signal ss = smooth(s,201); sf = (fftshift(fft(ss(1:n)))); %FFT of signal figure(1) plot(f,((20*log10((abs(sf))./max(abs(sf)))))) From my

Power spectral density of FFT

末鹿安然 提交于 2019-12-22 18:30:04
问题 I have a piece of code that gets the FFT of a part of the signal and I'm now trying to get the PSD, Fs = 44100; cj = sqrt(-1); %T=.6; dt = 1/Fs; left=test(:,1); right=test(:,2); time = 45; interval =.636; w_range = time*Fs: (time+interval)*Fs-1; I = left(w_range); Q = right(w_range); n = interval * Fs; f = -Fs/2:Fs/n:Fs/2-Fs/n; s = I+cj.*Q; % Smooth the signal ss = smooth(s,201); sf = (fftshift(fft(ss(1:n)))); %FFT of signal figure(1) plot(f,((20*log10((abs(sf))./max(abs(sf)))))) From my

Homomorphic Filter output

左心房为你撑大大i 提交于 2019-12-22 17:44:06
问题 I have written the following code to develop a Homomorphic Filter. I think (I am not sure though) the color images are being filtered well. In case of Grayscale images, Why is the kernel always Green? Also, the filter was supposed to be sharpening the image. But, its not doing so. What could have possibly gone wrong? . . Source Code: Here is the Github repository. public class HomomorphicFilter { public HomoMorphicKernel Kernel = null; public bool IsPadded { get; set; } public int Width { get

change an array of byte of audio sample to frequency

天涯浪子 提交于 2019-12-22 11:15:19
问题 First of all, I got a project to change the frequency of a WAVE file and I need to do so in Java. I have used AudioSystem in java to get the bytes of the audio data (excluding the file header). Now I get an array of bytes of the data, I want to change it from the time domain into the frequency domain and after manipulating the frequency, I want to change it back into the time domain. Here's the code: public byte[] getWAVByte(){ ByteArrayOutputStream out = new ByteArrayOutputStream(); try{

spike in my inverse fourier transform

你离开我真会死。 提交于 2019-12-22 08:08:27
问题 I am trying to compare two data sets in MATLAB. To do this I need to filter the data sets by Fourier transforming the data, filtering it and then inverse Fourier transforming it. When I inverse Fourier transform the data however I get a spike at either end of the red data set (picture shows the first spike), it should be close to zero at the start, like the blue line. I am comparing many data sets and this only happens occasionally. I have three questions about this phenomenon. First, what

Matlab fourier descriptors what's wrong?

核能气质少年 提交于 2019-12-22 06:57:43
问题 I am using Gonzalez frdescp function to get Fourier descriptors of a boundary. I use this code, and I get two totally different sets of numbers describing two identical but different in scale shapes. So what is wrong? im = imread('c:\classes\a1.png'); im = im2bw(im); b = bwboundaries(im); f = frdescp(b{1}); // fourier descriptors for the boundary of the first object ( my pic only contains one object anyway ) // Normalization f = f(2:20); // getting the first 20 & deleting the dc component f =

iPhone: CPU power to do DSP/Fourier transform/frequency domain?

泄露秘密 提交于 2019-12-22 04:25:18
问题 I want to analyze MIC audio on an ongoing basis (not just a snipper or prerecorded sample), and display frequency graph and filter out certain aspects of the audio. Is the iPhone powerful enough for that? I suspect the answer is a yes, given the Google and iPhone voice recognition, Shazaam and other music recognition apps, and guitar tuner apps out there. However, I don't know what limitations I'll have to deal with. Anyone play around with this area? 回答1: Apple's sample code aurioTouch has a

FFT implementation

邮差的信 提交于 2019-12-22 01:15:55
问题 I am working on application to enhance an image using FFT . I have implemented the code for FFT : For the first formula in above picture i have implemented code as below : void fft(int x , int y , int size) { for(int i=x; i<x+32 ; i++){ for(int j=y ; j<y+32 ; j++){ double kth = -2 * Math.PI * (((i*x)/size)+((j*y)/size)); ComplexNumber expo = new ComplexNumber(Math.cos(kth),Math.sin(kth)); output.values[i][j] = ComplexNumber.cMult(input.values[x][y],expo) ; intermediate.values[i][j] = output

Android app to record sound in real time and identify frequency

ぐ巨炮叔叔 提交于 2019-12-21 20:51:42
问题 I need to develop an app to record frequencies in real time using the phone's mic and then display them (in text). I am posting my code here. The FFT and complex classes have been used from http://introcs.cs.princeton.edu/java/97data/FFT.java.html and http://introcs.cs.princeton.edu/java/97data/Complex.java.html .The problem is when i run this on the emulator the frequency starts from some random value and keeps on increasing till 7996. It then repeats the whole process. Can someone plz help

FFT pitch detection for guitar string

房东的猫 提交于 2019-12-21 20:40:04
问题 I have simply pitch detection. Input (microphone) data are passed to fft routine, then I'm looking for a pitch with maximum value It means: Max(pow(data[i].getRe(), 2) + pow(data[i].getIm(), 2)) for 0<= i < SAmplesSize I need it for detection of guitar string's primary frequency. It works well for freq 440 hz (and maybe higher, i didn't check that) downto 250 hz. Below this value detected frequency is twice as high as it should be, ie. for 195 hz detected frequency is about 380 hz. It looks