signal-processing

From Amplitude or FFT to dB

五迷三道 提交于 2019-12-06 14:31:14
I've a Python code which performs FFT on a wav file and plot the amplitude vs time / amplitude vs freq graphs. I want to calculate dB from these graphs (they are long arrays). I do not want to calculate exact dBA, I just want to see a linear relationship after my calculations. I've dB meter, I will compare it. Here is my code: #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import scipy.io.wavfile as wavfile import scipy import scipy.fftpack import numpy as np from matplotlib import pyplot as plt fs_rate, signal = wavfile.read("output.wav") print ("Frequency

Trilateration of a signal using Time Difference(TDOA)

丶灬走出姿态 提交于 2019-12-06 14:29:02
I am having some trouble to find or implement an algorithm to find a signal source. The objective of my work is to find the sound emitter position. To accomplish this I am using three vibration sensors. The technique that I am using is multilateration that is based on the time difference of arrival. The time difference of arrival between each sensor are found using Cross Correlation of the received signals. I already implemented the algorithm to find the time difference of arrival, but my problem is more on how multilateration works, it's unclear for me based on my reference, and I couldn't

How can I capture audio input from 2 mics of my android phone real time and simultaneously

ぐ巨炮叔叔 提交于 2019-12-06 13:55:33
问题 I have a requirement where I need audio from both the mics on my android phone simultaneously in order to do some signal processing using Eclipse. Do you think it is possible to do this? Also can you suggest a method to start recording for both mics realtime simultaneously? For two instances of class AudioRecord, if I pass audio source as MIC and CAMCORDER respectively, will I be able to capture two separate mic inputs simultaneously? I am not sure if the mics will work in parallel, and also

Applying low pass filter

断了今生、忘了曾经 提交于 2019-12-06 13:21:54
I want to simulate an interpolator in MATLAB using upsampling followed by a low pass filter. First I have up-sampled my signal by introducing 0's. Now I want to apply a low pass filter in order to interpolate. I have designed the following filter: The filter is exactly 1/8 of the normalized frequency because I need to downsample afterward. (it's a specific excersise to upsample interpolate and downsample in this particular order.) However when I apply this filter to my data using the function filter(myfilter, data) the following signal is generated: I really don't know what is happening to my

How to generate pulses at 5khz with 0.01s duration and 0.09s delay?

荒凉一梦 提交于 2019-12-06 12:33:26
问题 I want to generate a continous pulse in Matlab. I would like to generate the signal at 5khz with a duration of 0.01s, then nothing for 0.09s and then starting again. It's kind of a rectangular pulse, except it's in 5khz. I have the following code to output a waveform for 0.01s at 5khz, function [ output ] = FreqGen( ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here fs = 44100; T = 0.01; t = 0:(1/fs):T; f = 5000; a = 0.5; output = a*sin(2*pi*f*t); end but I

How can I generate a sine wave with different frequencies using matlab?

十年热恋 提交于 2019-12-06 11:46:08
问题 For my project I need to generate a sine wave using matlab which has 100 000 samples and the frequency changes randomly after every 10 000 samples. The sampling rate and the frequencies can be as per convenience. Is there any function in matlab to generate this? 回答1: OK another example: to generate 5 randon frequencies :-) %range of possibles frequencies FrequenciesRandon = [200:1:500]; %number of randon frequencies ?? nf = 5; EndSignal=[]; for j = 1 : nf t = [ 0 : 1 : 10000]; % Time Samples

How to uniformly resample a non-uniform signal using SciPy?

穿精又带淫゛_ 提交于 2019-12-06 11:33:43
问题 I have an (x, y) signal with non-uniform sample rate in x . (The sample rate is roughly proportional to 1/x). I attempted to uniformly re-sample it using scipy.signal 's resample function. From what I understand from the documentation, I could pass it the following arguments: scipy.resample(array_of_y_values, number_of_sample_points, array_of_x_values) and it would return the array of [[resampled_y_values],[new_sample_points]] I'd expect it to return an uniformly sampled data with a roughly

Best way to convert for-loops into an FPGA

橙三吉。 提交于 2019-12-06 11:25:22
I am having trouble wrapping my head how to best replicate some C code in an FPGA using a for-loop (not my first time being stuck on this). The snippet of C code look like this: dot_product(&corr_sum, &sample_data_buffer[sample_index+d_circ_buf_size-sync_pattern_size], &sync_pattern[0], sync_pattern_size); abs_corr_sum += abs(corr_sum); Pretty straightforward, it is taking the dot product of two complex vectors and doing a cumulative sum of it. And he was my attempt to replicate it: always @(sample_index) begin // for each incoming sample abs_corr_sum = 64'd0; corr_sum = 64'd0; for (index2 = 0

plotting a parabola within part of a repeating signal using numpy

爷,独闯天下 提交于 2019-12-06 10:49:23
I have a repeating signal that varies a little bit with each cycle of a process that repeats roughly every second, though the duration and the contents of each cycle vary from each other a little bit within some parameters. There are a thousand x,y coordinates for every second of my signal data. A small, but important, segment of the data within each cycle is corrupted, and I want to replace each corrupted segment with an upward facing parabola. For each data segment that needs to be replaced by the parabola, I have the x,y coordinates of three points. The vertex/minimum is one of those points

What is the correct method to upsample?

我们两清 提交于 2019-12-06 10:44:06
I have an array of samples at 75 Hz, and I want to store them at 128 Hz. If it was 64 Hz and 128 Hz it was very simple, I would just double all samples. But what is the correct way if the samplerates are not a fraction of eachother? When you want to avoid Filtering then you can: handle signal as set of joined interpolation cubics curves but this point is the same as if you use linear interpolation. Without knowing something more about your signal and purpose you can not construct valid coefficients (without damaging signal accuracy) for example of how to construct such cubic look here: my