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

Random Sampling/Matlab/Matrix

I am trying to create a set of 320 matrices, each having dimensions 1152 x 241. Each matrix represents a different time step. I am trying to populate each cell, using a random value from another file. This other file is also dimensioned 1152 x…
Kevin_Q
  • 73
  • 2
  • 8
0
votes
1 answer

Sampling based on unique ID in r

I have 7500 messages, each with corresponding unique ID number. I have split up the messages into the seasons, and have have a block of messages for the seasons: winter 2013 ---- > spring 2014. I wish to create a sample of 1000 messages that is…
WeakLearner
  • 918
  • 14
  • 26
0
votes
2 answers

How to Use proc surveyselect to randomly select sample while a variable need to remain the same mean?

I have trouble with using proc surveyselect to randomly select sample from a population. Here is the scenario: I have a sample pool, say, 1000 observations, with variable ID, gender, income. My goal is to randomly select 400 samples to make a group…
Thomas
0
votes
2 answers

Enumerate all combinations of size N from k items with N > k

I have a problem where I have k items, say {0,1}, and I have to enumerate all possible N draws, say N=3. That is, I am trying to find all possible samples of a given size from a vector, with replacement. I can get there via the following loop…
learner
  • 1,895
  • 2
  • 19
  • 21
0
votes
1 answer

Weighted Sampling with multiple probability vectors in R

I have a similar question like this: Weighted sampling with 2 vectors I now have a dataset which contains 1000 observations and 4 columns for each observation. I want to sample 200 observations from the original dataset with replacement. But the…
0
votes
0 answers

Power calculation for non equi-sampled discrete signals

Consider a discrete signal S sampled at point x={2,5,9,11}, whose respective values are S(x)={300,312,340,400}. How would you calculate its power? If it was an equi-sampled signal, with sampling period T=1, I would just calculate sum(S^2(i))/N …
vitil
  • 256
  • 1
  • 3
  • 13
0
votes
1 answer

MySQL break down start and end timestamp into X number of samples

I'm after a method to dynamically create a list of time values between two dates in MySQL. For example, a user would enter in a start and end timestamp. E.G Start Date = 2014/01/01 00:00:00 End Date = 2014/01/02 00:00:00 The query would then…
Peter H
  • 871
  • 1
  • 10
  • 33
0
votes
0 answers

AudioCache Error - Soundpool suddenly unable to load sample from URL on Android

My SoundPool is in a Service and I use it to cache sounds from different urls, and play them later. The app was working fine, without any error, but today it crashed. The source code is the same, nothing changed. I tried to reinstall the app,…
keybee
  • 1,498
  • 20
  • 32
0
votes
1 answer

Build a Pandas pd.tseries.offsets from string

Pandas provides a method for DataFrame and Timeseries named resample. see http://pandas.pydata.org/pandas-docs/dev/timeseries.html and http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.resample.html this method have a parameter…
scls
  • 16,591
  • 10
  • 44
  • 55
0
votes
1 answer

iPhone Objective C Bluetooth Hands Freed Audio Increase 8000 sample rate

I am looking at the HFP in iOS. If I use code as follows (yes I am aware this was deprecated at iOS7), audio played via the bluetooth is at an 8000 sample rate. UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord; AudioSessionSetProperty…
NeilMortonNet
  • 1,500
  • 4
  • 16
  • 36
0
votes
1 answer

Reservoir Sampling algorithm not wroking

I have a project for my data mining class, in which I have to code the reservoir sampling algorithm for files. The program takes as input a number k, the name of the input file, and the name of the output file to be created. The output file must…
GGre
  • 3
  • 1
0
votes
1 answer

correlation analysis of two signal in matlab

let us consider following code >> load relatedsig.mat; >> [C1,lag1] = xcorr(T1,S); [C2,lag2] = xcorr(T2,S); figure ax(1) = subplot(211); plot(lag1/Fs,C1,'k'); ylabel('Amplitude'); grid on title('Cross-correlation between Template 1 and…
user466534
0
votes
2 answers

Working with a random sample within a for loop

I wish to draw 1,000 random samples of size 50 from the dataset and show that E(xi^ui) = 0 holds for each simulated sample. My code is below, and I have been trying to debug for some time now, but I can't figure out what's wrong. The dataset is…
0
votes
1 answer

If X is the rate out of Y number of words, then what is the rate out of a thousand words?

I am sorry if this seems like a stupid question. For some reason I just can't get my head around it. EDIT: What I mean is: If I have a text of 132891 words, and I can calculate the percentage of each word, how do I normalize it as if the rate…
Andreas Rudolph
  • 1,226
  • 19
  • 28
0
votes
1 answer

What characteristics should have a .wav file as result of TTS engine to be be listened with high quality?

I'm trying to generate high quality voice-over using Microsoft Speech API. What kind of values I should pass in to this constructor to guarantee high quality audio? The .wav file will be used latter to feed FFmpeg, so audio will be re-encoded latter…
user1785721