signal-processing

MPEG Audio Constant bit rate conversion

房东的猫 提交于 2021-02-05 11:34:07
问题 I am trying to convert few .wav files to .mp3 format The desired .mp3 format is : I tried with FFmpeg with this code : ffmpeg -i input.wav -vn -ac 2 -b:a 160k output1.mp3 This is the output of this command on one .wav format I am getting the result but two things are different Overall bit rate mode and Writing library Writing library: LAME3.99.5 vs LAME3.100 ( I think this shouldn't make any problem?) bit rate mode Constant Vs variable How to change bit rate mode from variable to Constant?

How can I use audio file as audio source in SpeechRecognition in Python?

有些话、适合烂在心里 提交于 2021-02-04 16:36:12
问题 I used speech_recognition.AudioFile in Python 3.6 , but this error was indicated: AttributeError: module 'speech_recognition' has no attribute 'AudioFile' This is my code: #!/usr/bin/env python3 import speech_recognition as sr # obtain path to "english.wav" in the same folder as this script from os import path AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "english.wav") # AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "french.aiff") # AUDIO_FILE = path.join(path

How to define LTI systems with Time delay in Scipy?

佐手、 提交于 2021-02-04 12:33:07
问题 The transfer function of an LTI system with time delay has a numerator term exp(-Td * s) where Td is the time delay. In Matlab, one could create such an LTI system in many ways (e.g. using the "s" operator and setting the exponential term directly or by setting the inputdelay outputdelay properties of tf objects.) However, I cannot find any way to do this in Scipy Signal LTI objects. I also checked the Python Control Systems Library, but still couldn't find a way. I do not want to use the

why weiner filter reduces only noise in my case, it is not reducing blur amount

不羁岁月 提交于 2021-01-29 14:28:22
问题 I am implementing weiner filtering in python which is applied on an image blurred using disk shape point spread function, i am including code of making disk shape psf and weiner filter def weinerFiltering(kernel,K_const,image): #F(u,v) copy_img= np.copy(image) image_fft =np.fft.fft2(copy_img) #H(u,v) kernel_fft = np.fft.fft2(kernel,s=copy_img.shape) #H_mag(u,v) kernel_fft_mag = np.abs(kernel_fft) #H*(u,v) kernel_conj = np.conj(kernel_fft) f = (kernel_conj)/(kernel_fft_mag**2 + K_const) return

Detecting Specific Sounds (Frequencies) with Python

点点圈 提交于 2021-01-29 11:30:30
问题 I want to record sound of a machine and want to detect if its present in another sound file that I record. I am able to record the sound of the machine and the sound file that I want to detect its presence. I am also able to take fft of the sound files, however I dont know If I should check specific frequencies or check it in time intervals. Can I implement it with aubio or is there another way? silent room silent room + sound 来源: https://stackoverflow.com/questions/53305661/detecting

How to simulate one step to a transfer function in python

怎甘沉沦 提交于 2021-01-29 08:28:28
问题 I've found scipy.signal.dstep , scipy.signal.dlsim functions that help simulate behavior of a transfer function, for example: signal.dlsim(signal.cont2discrete(([1], [1, 1]), 0.1), u=[1, 1], t=[0.0, 0.1]) allows to model 1/(s+1) function in [0, 0.1] time interval with control signal with value 1 . But these functions do not allow to model just one step with initial values. Are there any other functions that allow to model one step of a transfer function or how it's better to do it? 回答1: First

Convert IEEE float to TI TMS320C30 32bits float in python

穿精又带淫゛_ 提交于 2021-01-29 07:50:52
问题 I need to convert a python float to a TI DSP TMS320C30 float representation, following this convention: http://www.ti.com/lit/an/spra400/spra400.pdf#page=13 I've tried a few things, but I can't seem to wrap my head around the proposed algorithm. I also found a C version of the algorithm, but it looks like it is a version that runs in the TI DSP, so there are operations that I can't figure out (reverse the sign, for instance). I have a very naive implementation below, but it doesn't work... #

Using FFT-Convolution when stride>1

二次信任 提交于 2021-01-29 05:11:47
问题 The Fourier transform of the convolution (with stride 1) of two images is equivalent to point-wise multiplication of their individual Fourier transforms. I need to perform stride-'n' convolution using the above FFT-based convolution. For some reasons I need to operate in the frequency domain itself after taking the point-wise product of the transforms, and not come back to space domain by taking inverse Fourier transform, so I cannot drop the excess values from the inverse Fourier transform

Using FFT-Convolution when stride>1

倾然丶 夕夏残阳落幕 提交于 2021-01-29 05:08:47
问题 The Fourier transform of the convolution (with stride 1) of two images is equivalent to point-wise multiplication of their individual Fourier transforms. I need to perform stride-'n' convolution using the above FFT-based convolution. For some reasons I need to operate in the frequency domain itself after taking the point-wise product of the transforms, and not come back to space domain by taking inverse Fourier transform, so I cannot drop the excess values from the inverse Fourier transform

Theory behind ARMA and Running Average filter and are there any alternative algorithms for calculating distance from RSSI of signal?

99封情书 提交于 2021-01-29 04:55:27
问题 I can see that the Android Bacon Library features two algorithms for measuring distance: the running average filter and the ARMA filter. How are these related to the library's implementation (apart from using the filter's formula)? Where can I find some background information about these that explains the theory behind it? Are there any known alternative algorithms that can be studied and tried out for measuring the distance? 回答1: There are two basic steps to giving a distance estimate on BLE