signal-processing

Filtering signal with Python lfilter

别来无恙 提交于 2019-12-07 04:56:06
问题 I'm new with Python and I'm completely stuck when filtering a signal. This is the code: import numpy as np import matplotlib.pyplot as plt from scipy import signal fs=105e6 fin=70.1e6 N=np.arange(0,21e3,1) # Create a input sin signal of 70.1 MHz sampled at 105 MHz x_in=np.sin(2*np.pi*(fin/fs)*N) # Define the "b" and "a" polynomials to create a CIC filter (R=8,M=2,N=6) b=np.zeros(97) b[[0,16,32,48,64,80,96]]=[1,-6,15,-20,15,-6,1] a=np.zeros(7) a[[0,1,2,3,4,5,6]]=[1,-6,15,-20,15,-6,1] w,h

Count Steps using accelometer in android [duplicate]

一个人想着一个人 提交于 2019-12-07 04:54:25
This question already has answers here : Closed 7 years ago . Possible Duplicate: How to Count the Number of Steps Using the Accelerometer Are there any well known algorithms to count steps based on the accelerometer? Hi i have developed android application. In one module I have to create a pedometer . Now at this stage I have to count the steps user walked by using accelormeter. I have search on internet and found different methods but none of that working. I have tried this Does anyone have an idea how to achieve my goal? Any help is appreciated. The simplest solution would be to have a time

Wrong values in calculating Frequency using FFT

余生颓废 提交于 2019-12-07 02:13:36
问题 I'm getting wrong frequency, I don't understand why i'm getting wrong values.since i have calculating as per instructions followed by stackoverflow. I've used FFT from http://introcs.cs.princeton.edu/java/97data/FFT.java.html and complex from http://introcs.cs.princeton.edu/java/97data/Complex.java.html audioRec.startRecording(); audioRec.read(bufferByte, 0,bufferSize); for(int i=0;i<bufferSize;i++){ bufferDouble[i]=(double)bufferByte[i]; } Complex[] fftArray = new Complex[bufferSize]; for

Adding Accents to Speech Generation

為{幸葍}努か 提交于 2019-12-07 00:15:08
问题 The first part of this question is now its own, here: Analyzing Text for Accents Question: How could accents be added to generated speech? What I've come up with: I do not mean just accent marks, or inflection, or anything singular like that. I mean something like a full British accent, or a Scottish accent, or Russian, etc. I would think that this could be done outside of the language as well. Ex : something in Russian could be generated with a British accent, or something in Mandarin could

Sharpen the edges

醉酒当歌 提交于 2019-12-06 22:57:26
I am trying to detect the biggest/larger rectangular shape and draw bounding box to the detected area. I have tried different way to detect perfect edge ( Edges with no holes) for contour detection. I searched on stackoverflow and the solution proposed OpenCV sharpen the edges (edges with no holes) and Segmentation Edges did not work with my sample image. I would like to detect biggest/larger rectangular shape on the following two images Original Image 1 and Original Image 2 Below is the code that i use to preprocess the image before calling findcontour. public Mat processGrayScaleImage(Mat

changing frequency using fft and ifft not using whole numbers

和自甴很熟 提交于 2019-12-06 21:20:06
问题 I know I can change frequency by whole numbers by changing the variable shift but how can I change the frequency using numbers with decimal places like .754 or 1.2345 or 67.456 . If I change the variable 'shift' to a non-whole like number like 5.1 I get an error subscript indices must be either positive integers less than 2^31 or logicals from line mag2s = [mag2(shift+1:end), zeros(1,shift)]; Example Code below from question increase / decrease the frequency of a signal using fft and ifft in

Test driven development for signal processing libraries

浪子不回头ぞ 提交于 2019-12-06 18:47:39
问题 I work with audio manipulation, generally using Matlab for prototyping, and C++ for implementation. Recently, I have been reading up on TDD. I have looked over a few basic examples and am quite enthusiastic about the paradigm. At the moment, I use what I would consider a global 'test-assisted' approach. For this, I write signal processing blocks in C++, and then I make a simple Matlab mex file that can interface with my classes. I subsequently add functionality, checking that the results

Cross platform audio analysis library

筅森魡賤 提交于 2019-12-06 16:40:34
问题 I'm looking for a cross-platform library that allows me to analyze the waveform of a sound file. It needs to be able to at least have the ability to query the amplitude for a given sample, and it would be nice if it could do frequency detection. 回答1: Well, querying the amplitude for a given sample is rather easy, you only need to convert the sample's value to decibels. As for the other types of analysis, you'll probably find aubio to be a good tool. It can do frequency detection, and even

How does google app engine manipulate image data? How can you manipulate pixel data?

自作多情 提交于 2019-12-06 16:03:50
I want to get access to the low level pixel data to complete signal processing algorithms using GAE (which elimiated the use of BufferedImages and Java.awt.image classes) You can access the Image data by: ImagesService imagesService = ImagesServiceFactory.getImagesService(); Image oldImage = ImagesServiceFactory.makeImageFromBlob(blobKey); byte[] imageData = oldImage.getImageData(); So here is the issue: Color Images have 4 Bands (aRGB) but when you get the Image Data its a 1D byte array. 1) How does GAE store the image data into the bytes? (I imagine its just taking the 2D data and putting it

How calculate three phase kilowatt hour from time sampled data [closed]

不想你离开。 提交于 2019-12-06 15:25:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . My problem is I want to calculate three phase power from time sampled data of current and voltages. My questions: How can I calculate the energy (unit kilowatt hour) from time sampled data? Are any equations available? Is it needed to take the phase shift in account? (How can I calculate the phase shift? How do