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

Sampling weights for subpopulations in R

I'm working with a large, national survey that was collected using complex survey methods. As such, I'm needing to account for sample weights and other survey design features (e.g., sampling strata). I'm new to this methodology, so apologies if…
arrrrRgh
  • 197
  • 3
  • 15
0
votes
0 answers

Technique to Equalize Histogram Bin size and Ks Density Curve Bandwidth

I have also asked the query few days before because the clarification was vague so that's why I am uploading a query with updated views.Link is as follows. Updated :Technique used to control Step sizes (Quantization levels) of signals I am…
user7241892
0
votes
1 answer

Randomly assign different values to rows using different probability in R

Have such a data frame: ID var 1 NA 2 NA 3 NA 4 NA ... I need to randomly assign var values of 20% rows to be A, and 30% rows to be B, and 50% rows to be C. Is there some efficient way to solve this?
Gamp
  • 309
  • 1
  • 5
  • 15
0
votes
1 answer

Updated :Technique used to control Step sizes (Quantization levels) of signals

I have 2 nonlinear signals generated from sensors that were taken from different drives. I wanted to ask Is it possible to change or control the step size of signal in Matlab. My aim is to make the step size of 2 signals same though they are…
user7241892
0
votes
1 answer

Updated: Visualize signal with local maxima

I have a signal, and I want to add a plateau (Flattening) in my signal where ever I find local maxima. I have provided an example here to make my question easier to understand as the size of my real data is 1x1666520, so I cannot upload the whole…
Peter
  • 161
  • 1
  • 11
0
votes
0 answers

Why I got a negative value when sample a 3D texture and the data i set to texture are all positive?

ID3D11Texture3D* pTexture3D; D3D11_SUBRESOURCE_DATA initialData; initialData.pSysMem = data; initialData.SysMemPitch = 32 * 2; initialData.SysMemSlicePitch = 32 * 32 * 2; hr = g_pd3dDevice->CreateTexture3D( &texDesc, &initialData, &pTexture3D…
Doc.Q
  • 3
  • 4
0
votes
1 answer

Confidence Interval (CI) simulation in R: How?

I was wondering how I could check via simulation in R that the 95% Confidence Interval obtained from a binomial test with 5 successes in 15 trials when TRUE p = .5 has a 95% "Coverage Probability" in the long-run? Here is the 95% CI for such a test…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
0
votes
3 answers

C# Wrapping Radian Angles for XNA Dynamic Audio

EDIT 2 + Answer Turns out I needed to wrap between 0 and Frequency*2*Math.pi. Everyone who posted contributed to figuring out this issue. Since guest had the lowest reputation, I just marked his post as the answer. Thanks so much everyone, this was…
michael.bartnett
  • 787
  • 7
  • 20
0
votes
1 answer

sampling with raspberry in c

I need to analogread every 4ms, but I tested my code reading the execution time and it printed this: it's not 4ms, my code: #include clock_t start,end; double tempo; for(i=1; i <= 20; i++) { start=clock(); x =…
Emperon
  • 91
  • 8
0
votes
1 answer

simple random sampling while pulling data from warehouse(oracle engine) using proc sql in sas

I need to pull humongous amount of data, say 600-700 variables from different tables in a data warehouse...now the dataset in its raw form will easily touch 150 gigs - 79 MM rows and for my analysis purpose I need only a million rows...how can I…
Rohan
  • 93
  • 1
  • 8
0
votes
1 answer

Pandas: How to split a column of a dataframe, which follows powerlaw into two based on frequency distribution?

I have a data frame of 1 million records with 5 columns. unique_index,name,company_name,city_id,state_id Column, company_name, has 100k unique records. This follows a power law. Top 5000 company_names cover 70% of the records. I want to take equal…
pnv
  • 1,437
  • 3
  • 23
  • 52
0
votes
3 answers

How would I sample an audio tract at nyquist frequency using c and a micro-controller?

This is as simple and less vague as I can make it, so please and try to help me out. By this, meaning I want to: 1) Input an audio track (Anaglod) 2) Using the micro controllers ADC convert it to a digital output 3) Then Have the …
Andrew
  • 111
  • 1
  • 2
  • 10
0
votes
0 answers

Oversampling irreguler time series

I have a time series data from a motion sensor, the sampling frequency is about 200 [Hz] (i.e. the time intervals between the samples has a mean of 45 [ms] with a standard deviation of 0.5 [ms], so it's not evenly spaced perfectly). There are…
zixmarkiz
  • 13
  • 5
0
votes
0 answers

Replacing `dcauchy()` and `dt()` with `rcauchy()` and `rt()` in a Bayesian R code?

Below (in R code), I'm showing a simple Bayesian R code in which I use ddistribution.name() commands (i.e., dcauchy(), dt()) to estimate what I call "x" in my code. I then plot the answers. Coding Question: I was wondering if I could achieve an…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
0
votes
2 answers

how to representative sampling a dataframe in csv using pandas

I have a dataframe like below, print (df) column 1 column 2 column 3 0 mobile a Blanks 1 mobile b Blanks 2 mobile c cricket 3 laptop d cricket 4 phone e football 5 phone NaN …
Pyd
  • 6,017
  • 18
  • 52
  • 109