![]() Fortunately, sample-rate conversion (or resampling) methods allow us to change the sampling rate of a digital signal as needed. That is why I've asked about size of the data. Rates of 16000, 22050, 32000, 44100, and 48000 are all relatively common, and you can't rely on consistency from one file to the next. That is much more work, and also I can't see doing it with scipy, so it will be slow. to have cubic interpolation without that strange ups. Question is which option you prefer? Personally I don't like both of them, that is why I usually took 4 points and interpolate between them, then another points. ![]() And there are two results - orange x - representing linear interpolation, and green dots - cubic interpolation. If you execute it, you should see something like this:īlue crosses are initial function, your signal with non uniform sampling distribution. probably because a Gaussian filter is used there, meaning that the frequencies affected by the boost are a range in which 15khz is just the middle point. That is a bit updated example from scipy page. When I set the sample rate to 44.1KHz only (without resampling) in Sound Forge, and use a peak EQ at 15000Hz. Plt.plot(x, y, 'X', xnew, ylinear, 'x', xnew, ycubic, 'o') X = np.array()įcubic = interpolate.interp1d(x, y, kind='cubic') ![]() Please look at this rough solution: import matplotlib.pyplot as plt What is the proper way to re-sample my data uniformly, if not this? New_samplepoints = np.arange(nu_data, nu_data, delta) If I try to fix the range: construct the desired uniform x values myself and use them instead, the distortion remains: length = len(nu_data)ĭelta = (nu_data - nu_data) / length It doesn't look unaltered, and the x scale have been resized too. Plt.plot(nu_data, nu_data, uniform_data, uniform_data) Resampled = sg.resample(nu_data, length, nu_data) I'd expect it to return an uniformly sampled data with a roughly identical form of the original, with the same minimal and maximal x value. For the bit depth convert, the 24 bits -> 16 bits reduction is done without dithering (it's in the todo list to add dither options). Scipy.resample(array_of_y_values, number_of_sample_points, array_of_x_values) I have to ask the main dev about the algorithms, there's a checkbox in Wavosaur resample tool for 'filter' when downsampling, but i don't know much more. From what I understand from the documentation, I could pass it the following arguments: hello, you can try to change the playback speed by changing the global samplerate : menu Options -> Audio configuration, and change from 44100 to something higher. I attempted to uniformly re-sample it using scipy.signal's resample function. Recall that the nyquist frequency for 24KHz is 12KHz, so that the very highest frequency available to you in your 24KHz material is. (The sample rate is roughly proportional to 1/x). If you consider the fact that you are resampling from 24KHz to 48KHz a lot of the issues that the question raises are moot as there is going to be no audio to speak of in the vicinity of the resampling filters. I have an (x, y) signal with non-uniform sample rate in x.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |