signal-processing

Fourier transform of simple sin wave in matlab

邮差的信 提交于 2019-12-10 09:54:54
问题 I try to show spectrum of simple sin wave as we know a single sin wave with fixed frequency must have on peak in its spectrum I write this code but I can't get this one peak what is wrong in my code: clc nsteps=200;%number of signal elements in time domain i=sqrt(-1); NFREQS=100;%number of elements in frequency domain ddx=1e-9; dt=ddx/(6e8);%separation between each time domain elements lambdai=150e-9; lambdaf=500e-9; freqi=3e8/lambdai; freqf=3e8/lambdaf; freq=zeros(1,NFREQS); for j=1:NFREQS

Increase/Decrease Play Speed of a WAV file Python

半世苍凉 提交于 2019-12-10 09:23:48
问题 I want to change play speed (increase or decrease) of a certain WAV audio file using python wave module. I tried below thing : Read frame rate of input file. Double the frame rate. Write a new wave file with increased frame rate using output_wave.setparams() function. But its not working out. Please suggest. Thanks in Advance, 回答1: WOW! if you no matter to change the pitch when you increase or decrease the speed, you can just change the sample rate ! Can be very simple using python: import

Finding the 'volume' of a .wav at a given time

天涯浪子 提交于 2019-12-10 06:28:04
问题 I am working on a small example application for my fourth year project (dealing with Functional Reactive Programming). The idea is to create a simple program that can play a .wav file and then shows a 'bouncing' animation of the current volume of the playing song (like in audio recording software). I'm building this in Scala so have mainly been looking at Java libraries and existing solutions. Currently, I have managed to play a .wav file easily but I can't seem to achieve the second goal.

Units of frequency when using FFT in NumPy

*爱你&永不变心* 提交于 2019-12-09 17:12:13
问题 I am using the FFT function in NumPy to do some signal processing. I have array called signal which has one data point for each hour and has a total of 576 data points. I use the following code on signal to look at its fourier transform. t = len(signal) ft = fft(signal,n=t) mgft=abs(ft) plot(mgft[0:t/2+1]) I see two peaks but I am unsure as to what the units of the x axis are i.e., how they map onto hours? Any help would be appreciated. 回答1: Given sampling rate FSample and transform blocksize

Can someone here has a sample of high pass filter for PCM audio data?

落花浮王杯 提交于 2019-12-09 14:16:53
问题 Good day. I am poor of DSP. I have difficulties understanding the algorithm. I have a c# application, a recorder function that will record a sound waves but this sound is a mixture of all sounds. specifically, when i receive the data i will filter this data to save only the filtered audio data with high frequency, example cutoff frequency is 15khz. For this filter, given are the samples of data with size, and the cutoff frequency C/C++ is fine At the time i received that samples of data,

Finding periodicity in an algorithmic signal

丶灬走出姿态 提交于 2019-12-09 10:51:20
问题 In testing a conjecture about the following recursive relation , which claims a periodicity of some kind for the sequence of numbers, I wrote a python program which computes the sequences and prints them in a table. 1 # Consider the recursive relation x_{i+1} = p-1 - (p*i-1 mod x_i) 2 # with p prime and x_0 = 1. What is the shortest period of the 3 # sequence? 4 5 from __future__ import print_function 6 import numpy as np 7 from matplotlib import pyplot as plt 8 9 # The length of the

Acoustic Echo Cancellation (AEC) in embedded software

主宰稳场 提交于 2019-12-09 07:53:38
问题 I am doing a VoIP project on embedded device. I have built a sample using a 32bits MCU with a low grade audio codec. Now I found that there is echo issue on my device, that is I can hear what I said from the speaker. I have do some research and found that most appliaction use a DSP codec with acoustic echo cancellation feature. However, is it possible that I do the acoustic echo cancellation in the software, using my 32bits MCU? Can you adive the algorithm, or even source code:P, for doing

How Do I do Real Time Sound/Signal Processing On The iPhone?

↘锁芯ラ 提交于 2019-12-09 07:12:59
问题 I may be doing an iPhone-based application doing near-real-time sound-processing (filtering, etc). I was wondering the best way to get started. Would I want to create an audio cue for recording and processing sound, as described here? Edit: I should be clear. I am not asking how to do signal processing, in general. I know some of that and my team's expert will handle the rest. I asking what the "low level" interfaces to sound data on the iphone are. Edit2: My iphone development has been

how to improve the resolution of the PSD using Matlab

北战南征 提交于 2019-12-09 07:05:13
问题 I have and audio signal, which I read with Matlab, and use pwelch to get its PSD, here ist the code that I'm using [x,Fs] = audioread('audioFile.wav'); x= x(:,1) % mono [xPSD,f] = pwelch(x,hamming(512),16,1024,Fs); plot(f,xPSD); since the FS=96000 and I'm only interrested in Frequencies bellow 5khz, I would like to calculate the PSD only for the area, and also being able to adjust the resolution of the PSD ! any idea hwo to do that ! 回答1: When calculating PSDs with pwelch , there is always a

simulator of realistic ECG signal from rr data for matlab or python

偶尔善良 提交于 2019-12-09 06:25:22
问题 I have a series of rr data (distances between r-r peak in PQRST electrocardiogramm signal) and I want to generate realistic ECG signal in matlab or python. I've found some materials for matlab ( ecg built-in function in matlab) but I can't figure out how to generate it from rr data, and I've found nothing for python. Any advice? 回答1: Does this suit your needs? If not, please let me know. Good luck. import scipy import scipy.signal as sig rr = [1.0, 1.0, 0.5, 1.5, 1.0, 1.0] # rr time in