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

Matlab: generating a monte carlo sample from a defined model

I am trying to generate a Monte Carlo sample of the following model: y=20/sqrt(x1)*10^((x2-x3)/20)*x4*10^((x5-x6)/20). In Matlab, am using the following code to generate a random sample of N size for the k variables. The input variables are…
0
votes
0 answers

iOS Audio Toolbox buffer size

In an iOS application, the minimum buffer duration of 4 milli seconds is required. But the Audio toolbox framework provides, 23 milli seconds for 16kHz, mono channel configuration. i.e. it gives 742/744 bytes at each input callback. How to make the…
ArunJTS
  • 264
  • 5
  • 15
0
votes
0 answers

Latin hypercube sample from a single random variable

I use Simple Random Sampling and Latin Hypercube Sampling in order to find the differences between the 2 methods as we calculate the variable for 1 pixel of an image and see the differences for the 2 methods of the Means and Variances. The number of…
Loukas K.
  • 1
  • 3
0
votes
1 answer

Generating same random variable in Rcpp and R

I am converting my sampling algorithm from R to Rcpp. Output of Rcpp and R are not matching there is some bug in the Rcpp code ( and the difference is not different because of randomization). I am trying to match internal variables of Rcpp with…
vinash85
  • 431
  • 4
  • 15
0
votes
2 answers

Matlab signal processing tutorial: Basics of signal resampling

I have absolutely basic question about sampling rate with regard to this tutorial: http://www.mathworks.com/help/signal/examples/measuring-signal-similarities.html (first section) Two first signals have FS=4096, while the third is 8192. In simple…
user1597969
  • 405
  • 2
  • 5
  • 13
0
votes
2 answers

How to cut data in even pieces in R?

Here is the problem: I have a dataset, let's say: a <- c(0,0,0,0,1,1,1,1,1,1) I want to cut it into even pieces (e.g. 5 pieces ). The problem is I cannot use quantiles or cut because some values repeat, so you cannot set distinct breakpoints. >…
Tim
  • 7,075
  • 6
  • 29
  • 58
0
votes
1 answer

Sampling from different distributions using mean and variance of a normal distribution

Given a mean and a variance of a normal distribution, I want to generate random numbers from a any given distribution. for eg: Beta, Gamma or a Poisson distribution in Matlab. If for eg: I am given a number, 0.1 and i want to generate random numbers…
viggie
  • 183
  • 1
  • 3
  • 11
0
votes
2 answers

How can I avoid if else statements within a for loop?

I have a code that yields a solution similar to the desired output, and I don't know how to perfect this. The code is as follows. N = 4; % sampling period for nB = -30:-1; if rem(nB,N)==0 xnB(abs(nB)) = -(cos(.1*pi*nB)-(4*sin(.2*pi*nB))); …
0
votes
1 answer

FIR Filter, Sampling frequency vs bandwidth

In a FIR filter the ratio between the bandwidth and the sampling frequency is costant? I mean, if I use the same coefficients but with the double Fs, will I have also double BW?
Daniele Peruzzini
  • 101
  • 1
  • 1
  • 4
0
votes
1 answer

Sample classification by probability

I have fitted mixture distributions to multi-modal biological measurement data in order to group individuals accordingly (picture a multi-modal histogram of length measurements; assuming each mode represents a different age cohort I can infer…
niafall
  • 164
  • 1
  • 1
  • 11
0
votes
1 answer

Android realtime audio acquisition - losing some samples?

I wrote this class, to acquire audio data. I want to use the audio input to sample realtime RF signals. I sample @ 44kHz, and I expect to know the elapsed time by measuring the total acquired samples, knowing the sample frequency. I don't know why I…
Gaucho
  • 1,328
  • 1
  • 17
  • 32
0
votes
1 answer

Taking random sub-samples from a dataframe

I am looking to take 1000 random sub-samples from this data-frame.....i.e., I want R to randomly select 100 individuals from the data, 1000 times. Taxa Abundance 159 3 161 45 163 3 165 7 167 44 169 93 171 94 173 16 175 9 177 8 195 8 261 18 263…
user28246
  • 3
  • 3
0
votes
2 answers

trouble getting flashdevelop to correctly identify sampling rate of a sound file

I'm trying to put a sound file into a flash program with the following code. [Embed(source="../lib/DST-Aircord.mp3")] static var sndtrck:Class; //used to represent the background music file static var soundtrack:Sound; //used to handle the…
avorum
  • 2,243
  • 10
  • 39
  • 49
0
votes
2 answers

How to dynamically get Top N percent records within group in Pig

I have a problem that I am not sure how to solve in Pig. I have a dataset on Hadoop (approx. 4 million records) which contains product titles by product category. Each title has the no. of times it showed up on the web page, and no. of times it was…
axm2064
  • 149
  • 1
  • 1
  • 7
0
votes
1 answer

Implementing Reservoir Sampling using Map Reduce

This link "http://had00b.blogspot.com/2013/07/random-subset-in-mapreduce.html" talks about how one can implement reservoir sampling using map reduce framework. I feel their solution is complicated and the following simpler approach would…
AbhishekPrateek
  • 135
  • 1
  • 4
1 2 3
99
100