Questions tagged [sampling]

In signal processing, sampling is the reduction of a continuous signal to a discrete signal. In statistics, sampling is the selection of a subset of individuals from within a statistical population to estimate characteristics of the whole population.

This tag should be used for questions related to programming solutions related to sampling.

Sampling can be done for functions varying in space, time, or any other dimension, and similar results are obtained in two or more dimensions. More information in Wikipedia - sampling (signal processing).

For statistical sampling, see Wikipedia - sampling (statistics) for more.

1593 questions
0
votes
0 answers

Need some reference articles for sample size determination in clinical trials

I'm working with some clinical trial study. So I need some articles for determination of sample size in different types of clinical studies. I already have googled it. If anyone expertise in this field can suggest me some artiles that will very…
0
votes
1 answer

Reservoir sampling without specifying a reservior size as input (only a uniform sampling ratio is specified)

I understand that for both the conventional and the weighted reservoir sampling algorithms, the user has to specify the size of the reservoir as the input. Is there any reservoir sampling algorithm that takes as the input only a uniform sampling…
rabbit686
  • 79
  • 5
0
votes
3 answers

Different run speeds in python

I want to get a sample from serial port in python. but when I run the code to know the rate of it, python gives me different values! it is usually about 24000 time per second. But sometimes it returns 14000. What is this big difference's reason ?…
Mahdi Jedari
  • 712
  • 1
  • 7
  • 16
0
votes
0 answers

Is it possible to use in perf as sampling period the number of cycles?

I have tried to measure the performance counters using perf for different sampling periods and for this I used the -I option. But this measures the sampling interval in milliseconds. Is it possible to use with perf a sampling interval measured in…
AN00
  • 325
  • 4
  • 13
0
votes
1 answer

stratified sampling R - more directions needed

To reduce the dataset, I have been advised to use "stratified sampling". Because I'm very new to the R programming, current articles on Stack aren't easy to follow, there is very little explanation. I have a data set of over 60000 obs. and 24…
AgiZet
  • 1
  • 1
0
votes
1 answer

Setting sensor reporting mode as continuous in android for constant sampling rate

I want data from multiple android sensors (TYPE_ROTATION_VECTOR and TYPE_LINEAR_ACCELERATION) at a constant sampling period of 20 ms. Also I want both of the sensors values to have exact correspondence in values w.r.t time axis. This documentation…
Saad Qureshi
  • 728
  • 2
  • 7
  • 21
0
votes
1 answer

Use a texture's alpha channel as a border map

Okay, so this is a bit complicated (at least for me), and I haven't been able to find any kind of solution anywhere. I'm making a 2D golf game in OpenGL. The background is a texture that I made that will have a map of the course. The problem is that…
TheTrueJard
  • 471
  • 4
  • 18
0
votes
1 answer

Set sampling frequency for audio from analogRead from arduino

I am using a Sparkfun Electret Microphone with Arduino Pro-Mini to stream audio over serial port. The goal is to create a wav file from the audio data. The wav file header requires "sampling frequency" as one of the entries in the header. Here are…
Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
0
votes
2 answers

How to know from which of 2 distributions the sample is drawn in R?

I am writing a pop simulation using R. The "growth" parameter in this simulation is sampled with probability p from two normal distributions with different means and sd. The code I am using to do so is the following: R_0 <-…
Cinghio
  • 302
  • 1
  • 4
  • 14
0
votes
1 answer

How to take random sample of a cvs file in Python?

I am new to Python and want to learn Data Wrangling process using it. I am using jupyter for this. I have a file named fle with 81,000 rows and 89 columns. I want to randomly select about 100 rows from it. How do I do that? I keep on getting…
Dee
  • 51
  • 3
0
votes
1 answer

Sampling from a boolean matrix in Eigen

I have a matrix A of this form: Eigen::Matrix A(n, m) and I want to obtain a random element among the ones that are 'true'. The silly way to do that would be to obtain the number of 'true' elements t, generate a random number between 1…
0
votes
1 answer

what are the sampling methods in spark? Why not reservoir sampling?

I know reservoir sampling can be applied in parallel, but spark seems use the other sampling methods I have no idea about. could someone describe them briefly? According to @Tristan answer, I guess the purpose of not using reservoir sampling is to…
cstur4
  • 966
  • 2
  • 8
  • 21
0
votes
2 answers

How to do proportionate stratified sampling without replacement?

I want to select my sample in Stata 13 based on three stratum variables with 12 strata in total (size - two strata; sector - three strata; intangible intensity - two strata). The selection should be proportional without replacement. However, I can…
Tobias
  • 1
  • 1
  • 3
0
votes
1 answer

Control gain of sound channels individually using Java

I've written this small signal generating method. My goal is to generate a beep with a slight time delay between the two channels (left and right) or a slight difference in gain between the channels. Currently I create the delay by filling a buffer…
TheFooBarWay
  • 594
  • 1
  • 7
  • 17
0
votes
1 answer

Android Smartwatch sampling frequency

I've been using Sony Smartwatch 3 for recording accelerometer data on long time periods (8 hour on average). Below is the main code block: ax,ay and az are arraylists for storing the sensor values and ta is an arraylist with the corresponding…