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

Plotting sampling graph on VB.NET

I am collecting data from an Arduino and transmit on Visual Basic through the serial port. Now I wanted to plot a graph with time vs electrical energy (unit kWh) - time along the x-axis and electrical energy along the y-axis. Usually I am getting…
user50949
  • 37
  • 2
  • 7
0
votes
2 answers

Splitting Dataframe into Confirmatory and Exploratory Samples

I have a very large dataframe (N = 107,251), that I wish to split into relatively equal halves (~53,625). However, I would like the split to be done such that three variables are kept in equal proportion in the two sets (pertaining to Gender, Age…
Twitch_City
  • 1,236
  • 1
  • 10
  • 22
0
votes
0 answers

Generating samples for any distribution

I want to generate 1000 samples from a distribution in python: p(x1, ..., xn) = p(x1)p(x2|x1)(x3|x2)...p(xn|xn-1) where xn can take 0or 1 where p(x1=1) = 0.75, p(x_n = 1|x_n-1 = 1)=0.75 and p(x_n = 0|x_n-1 = 0)=0.75 and then count the number of…
VeilEclipse
  • 2,766
  • 9
  • 35
  • 53
0
votes
1 answer

How to correct efp() error "invalid type (list) for variable 'data'"?

I have a large(>100,000) single column floating point time-series data. I want to find structural changes within the data with respect to time( in my case index). In-order to do that, I am using R strucchange package. But I'm getting error. I expect…
precision
  • 293
  • 2
  • 15
0
votes
1 answer

sampling time counter in simulink

how can I take simulink time from "clock" block in simulink and then increase a counter (k) in a matlab embedded function at every sampling period Ts? let us say if simulink clock time is t, then we may consider if mod(t, Ts)==0 k=k+1; end but…
user3489173
  • 45
  • 1
  • 9
0
votes
1 answer

Create sample array from 32bit sample size WAV

I got a WAV (32 bit sample size, 8 byte per frame, 44100 Hz, PCM_Float), which in need to create a sample array of. This is the code I have used for a Wav with 16 bit sample size, 4 byte per frame, 44100 Hz, PCM_Signed. private float[]…
Corn
  • 47
  • 7
0
votes
1 answer

Allocate random zone to data frame

I'd like to allocate a random zone to all the elements in a data frame. Say data frame has the structure: df: age-height-nation - zone 13,'tall','American', - ..... 11,'tall','S.american', - and I want to fill the column [zone], being the possible…
user3310782
  • 811
  • 2
  • 10
  • 18
0
votes
1 answer

Bootstrap Sampling in R on large data (too large to fit in RAM)

Is it possible to draw bootstrap samples from an .Rdata object, or any other large data object stored on disk? My current approach for sampling from very large data is to build a local MySQL database, and then draw random samples into R using SQL.…
Ben Rollert
  • 1,564
  • 1
  • 13
  • 21
0
votes
1 answer

Matlab - effect of different sampling rates on FFT phase spectrum

I am new to Matlab and still getting to grips with FFT. I am currently working on a project where I have two cosine signals, both having a frequency of 100 Hz, but the second signal is delayed by a certain time - say 0.0030 seconds. Knowing the…
Varun
  • 1
0
votes
1 answer

better way of sampling in Hadoop MapReduce

I want 20 % of sample data from the input dataset. I thought of 2 approaches: Initially emitting 20 % data from each mapper (single mapper emits 20% of data).Then, the reducer finds 20 % of mapper data after shuffle and sort.(Same procedure…
USB
  • 6,019
  • 15
  • 62
  • 93
0
votes
1 answer

Real time sampling pattern

I have a sensor which receives data at random times at a high frequency and I need a rolling time series window of a specified size (e.g 60 data points) at a specified frequency (e.g 1 data point per second). The sampled value should be the latest…
0
votes
1 answer

Bootstrapping with Replacement

I'm reading a paper and am confused with their described Bootstrap Method. the text says: the uncertainties associated with each stacked flux density are obtained via the bootstrap method, during which random subsamples (with replacement) of…
user3727154
  • 35
  • 1
  • 1
  • 7
0
votes
1 answer

stratified sampling not working correctly in weka

I have a dataset which i applied StringtoWordVector and remove filter and then removed 1 fold using StratifiedFolds This is the samples i have. My random seed is 0. However, When i chained the stringtowordvector with a attributeEval filter then…
aceminer
  • 4,089
  • 9
  • 56
  • 104
0
votes
0 answers

How do you calculate the sampling rate of a time varying signal?

I'm trying to apply a filter method (Butterworth) in MATLAB to remove a static acceleration (gravity). The problem here is the sampling rate seems to be varying. As far as I know, the sampling rate is defined as the number of samples obtained in…
user3602893
  • 35
  • 1
  • 8
0
votes
1 answer

How to perform oversampling in SAS?

I have a data set with 1100 samples, target class isReturn, there are 800 isReturn='True' 300 isReturn='False' How can I use PROC SURVEYSELECT to oversample the 300 isReturn='False' so that I will have 800 isReturn='False' to make the data set…
Kevin
  • 2,191
  • 9
  • 35
  • 49