Questions tagged [downsampling]
231 questions
31
votes
8 answers
Downsampling wav audio file
I have to downsample a wav file from 44100Hz to 16000Hz without using any external Python libraries, so preferably wave and/or audioop. I tried just changing the wav files framerate to 16000 by using setframerate function but that just slows down…

d3cr1pt0r
- 481
- 1
- 5
- 9
17
votes
0 answers
iOS AudioUnit recording at 8kHz sample rate yields in silence
I'm building a voip application where we need to record audio from the microphone and send it somewhere in 8kHz sample rate.
Right now I'm recording it in default sample rate, which in my case was always 44,1k. This is then manually converted to 8k…

Ryupold
- 191
- 6
16
votes
3 answers
How to downsample images correctly?
Background
Creating an app that has a lot of high quality images, I've decided to downscale the images to the needed size (meaning that if the image is larger than the screen , I downscale it ) .
The problem
I've noticed that on some devices, if the…

android developer
- 114,585
- 152
- 739
- 1,270
13
votes
10 answers
Downsampling and applying a lowpass filter to digital audio
I've got a 44Khz audio stream from a CD, represented as an array of 16 bit PCM samples. I'd like to cut it down to an 11KHz stream. How do I do that? From my days of engineering class many years ago, I know that the stream won't be able to…

twk
- 16,760
- 23
- 73
- 97
8
votes
1 answer
How do I downsample a 1d numpy array?
This seems like a very straight forward problem but I can't figure out a solution. Suppose I have a sine function y with 8000 samples:
import numpy as np
Fs = 8000
f = 1
npts = 8000
x = np.arange(npts)
y = np.sin(2 * np.pi * f * x / Fs)
I want to…

user5503831
- 115
- 1
- 2
- 7
8
votes
3 answers
Downsample PCM audio from 44100 to 8000
I've been working on a audio-recognize demo for some time, and the api needs me to pass an .wav file with sample rate of 8000 or 16000, so I have to downsample it. I have tried 2 algorithms as following. Though none of them solves the problem as I…

tristan_jia
- 93
- 1
- 1
- 9
8
votes
6 answers
Downsampling the number of entries in a list (without interpolation)
I have a Python list with a number of entries, which I need to downsample using either:
A maximum number of rows. For example, limiting a list of 1234 entries to 1000.
A proportion of the original rows. For example, making the list 1/3 its original…

Dave
- 125
- 1
- 2
- 5
8
votes
2 answers
How to downsample a pandas dataframe by 2x2 averaging kernel
I am trying to downsample a pandas dataframe in order to reduce granularity. In example, I want to reduce this dataframe:
1 2 3 4
2 4 3 3
2 2 1 3
3 1 3 2
to this (downsampling to obtain a 2x2 dataframe using mean):
2.25 3.25
2 …

gc5
- 9,468
- 24
- 90
- 151
7
votes
5 answers
Algorithm for downsampling array of intervals
I have a sorted array of N intervals of different length. I am plotting these intervals with alternating colors blue/green.
I am trying to find a method or algorithm to "downsample" the array of intervals to produce a visually similar plot, but with…

hampusohlsson
- 10,109
- 5
- 33
- 50
7
votes
4 answers
How do I sample a matrix in MATLAB?
I have a matrix in MATLAB from which I want to sample every other entry:
a =
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
And I want:
result =
1 9
3 11
How can I do…

Nathan Fellman
- 122,701
- 101
- 260
- 319
6
votes
1 answer
When the Matlab function image displays a matrix with more elements than pixels on a screen how does it decide which matrix elements to display?
I am trying to look for trends in a large data matrix, say 50,000 x 1000 elements. If I use the image command the matrix is printed to the screen. I would like to know how Matlab's image function decides which elements of the matrix to display…

user1860389
- 101
- 3
6
votes
1 answer
Java - downsampling wav audio file
Hi I need to downsample a wav audio file's sample rate from 44.1kHz to 8kHz. I have to do all the work manually with a byte array...it's for academic purposes.
I am currently using 2 classes, Sink and Source, to pop and push arrays of bytes. …

Jean-Francois Hamelin
- 633
- 2
- 9
- 19
6
votes
2 answers
What's the best filter for downsampling text?
I'm using ImageMagick to downsample text. I realize that there's no such thing as the best filter for every situation, but I'm thinking there must be a generally-accepted standard when it comes to downsampling text specifically (I could be wrong).…

David Jones
- 10,117
- 28
- 91
- 139
5
votes
1 answer
Question about OpenCV resize's INTER_AREA working domain (func != 0 && cn <= 4 in function 'cv::hal::resize' failure)
I have a question about the working domain of OpenCV's resize function when using the INTER_AREA interpolation. Here are three different interpolations:
import cv2
import numpy as np
cv2.resize(np.zeros((17, 99, 99), dtype=np.uint8), (64, 32),…

user209974
- 1,737
- 2
- 15
- 31
5
votes
1 answer
Downsampling Time Series: Average vs Largest-Triangle-Three-Buckets
I'm programming lines charts with the use of Flot Charts to display timeseries.
In order to reduce the number of points to display, I do a downsampling by applying an average function on every data points in the same hour.
Recently, I however…

Klun
- 78
- 2
- 25