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
1 answer

How to draw a systematic sample from a geographic population?

I have a data frame (df) representing a 100X100 unit square, and after having created a geographic population like this (z= x+y, where x<-df$x, and y<-df$y), I need to extract a systematic sample of size n=100 from it. How can I do it ?
27titanik
  • 21
  • 5
0
votes
1 answer

Sampling data frame to have 2 level categorical equal probality

I am trying to accomplish the following: I have a dataset with many variables and among them one called Gender, so with 2 levels "M" and "F". I want to sample without replacement this dataset, in let's say 1000 observations so I get equal number of…
0
votes
1 answer

Manage values from encoder to understand the direction of the encoder itself (counterclockwise or clockwise)

I'm sampling an encoder and this sample has a value between the interval [30, 230]; I have to use this value to define two output counter variables (one increasing counter and one decreasing counter). The problem is that sometimes when there is a…
L. Vee
  • 13
  • 4
0
votes
1 answer

Sampling with restriction in R

I have to create a profile with 3 characteristics that is a combination of these 3 lists: Char1<-c("a1","a2","a3") Char2<-c("b1","b2","b3") Char3<-c("c1","c2") A profile would look something like: [“a1”, “b2” , “c2”] or [“a3”,”b1”,”c1”]. I have a…
Quan Mai
  • 11
  • 3
0
votes
1 answer

Real Time Workaround using windows for fixed sampling time

I am trying to collect data off an accelerometer sensor. I have an Arduino doing the analog to digital conversion of the signal and sending it through a serial port to MATLAB on Windows. I send a reading every 5ms from the Arduino through the serial…
AnarKi
  • 857
  • 1
  • 7
  • 27
0
votes
1 answer

Beaglebone Black sampling rate too slow and gives false voltage libpruio

I'm pretty much a noob when it comes to this kind of thing, so if you guys could either help me or direct me to a place to learn what I need to know, I would greatly appreciate it. Basically my problem is that I am using the libpruio library to…
0
votes
0 answers

Matlab data sampler that weights the outputs to binary (0,1)

a sample probability matrix: ans = 0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052 0.1444 0.0456 0.0138 0.0126 0.0116 0.0107 0.0052 0.1222 0.0386 0.0116 0.0106 0.0098 0.0091 0.0044 …
Amir
  • 1,348
  • 3
  • 21
  • 44
0
votes
1 answer

How is signal frequency stored during pulse code modulation?

I am new to the concepts of Sampling and Quantization, and despite reading many articles, I am not clear on how PCM works if I record a simple sound. If I record the note A3 (220hz) at 44.1 KHz sampling rate, 16 bit quantization and mono channel for…
dev
  • 11,071
  • 22
  • 74
  • 122
0
votes
1 answer

Azure machine learning even sampling

I'm trying to do some basic multi-label classification in Azure ML. I have some basic data in the following format: value_x value_y label x1 y1 label1 x2 y2 label1 x3 y3 label2 ..... My problem is that in my data…
0
votes
1 answer

How to repeat 1000 times this random walk simulation in R?

I'm simulating a one-dimensional and symmetric random walk procedure: $$y_t=y_{t-1}+\varepsilon_t$$ where white noise is denoted by $\varepsilon_t \sim N(0,1)$ in time period $t$. There is no drift in this procedure. Also, RW is symmetric, because…
Übel Yildmar
  • 491
  • 1
  • 9
  • 24
0
votes
1 answer

How to classify the recorded data from multiple sensors?

I'm tring to build a glove that will be able to recognize gestures by using arduino that is connected to flex sensors and an accelerometer (maybe also an emg sensor). I am able to record all these data from the sensors that I read. What I want is to…
user2949556
  • 47
  • 1
  • 7
0
votes
1 answer

"Optimum" sampling interval of sensor system

I am working with a system, S1, where many remote devices report in to a central server at constant intervals, f. Each device reports asynchronously with the rest of the system. The (complete) state of S1 can be queried via a request-response…
Tony Laidig
  • 1,048
  • 2
  • 11
  • 33
0
votes
0 answers

R: Draw samples to match known proportions

Let's say I have a dataset that looks like this: set.seed(2016) d <- data.frame(x=rnorm(1000), y=sample(x=c("A", "B", "C"), size=1000, replace=TRUE)) I have some method that selects a subset: s <- data.frame(x=rnorm(100), …
Misconstruction
  • 1,839
  • 4
  • 17
  • 23
0
votes
2 answers

Discarding samples according to a condition

I wish to write a loop in R within which Poisson samples are simulated, but I wish to discard samples that do not contain any zeros and "have another go". How may I do this?. For example: X<-rep(999,100) for(j in…
Pauljw11
  • 1
  • 1
0
votes
1 answer

Generate samples from frequency table with fixed values

I have a population 2x2 frequency table, with specific values: 20, 37, 37, 20. I need to generate N number of samples from this population (for simulation purposes). How can I do it in R?
Tanja
  • 1