08-13-2019 03:20 PM
I am using redpitaya for data acquisition, its buffer has 16348 samples but I need more to do a high precision FFT , therefore I would need a buffer in Labview for about 800 thousand samples, therefore I need to append the blocks I am receiving from the redpitaya but there is a distortion between blocks, is any function in Labview that may help me to properly align the end of a block with the beginning of the next?
thanks
08-14-2019 12:47 AM
Hi tecno,
basic LabVIEW knowledge: use BuildArray to concatenate arrays.
(When you know the needed size of your data before reading them from your RedPitaya then you could also InitArray of desired size and use ReplaceArraySubset to fill in those samples at the right place…)
08-14-2019 12:22 PM
Hi GerdW:
I think the problem I have will not be solved with BuildArray, lets say we are sampling a 10 Khz sine wave, the end of the block of 16384 samples will not coincide with the beginning of the next block, it will make a distortion, and depending on the frequency a big spike, there is a pic attached, you can see at the beginning the amplitude is 0.45 and at the end is -0.45, if you change frequency the amplitudes are different
Thanks
08-14-2019 12:41 PM
What do you know about your blocks of samples? Is it correct to assume that, within a block, the time difference between successive samples is the same? In other words, within a block, there is a constant sampling frequency?
What (if anything) do you know about the spacing between blocks of samples? Those of us who sample using LabVIEW and modern A/D hardware are used to "continuous" sampling, where the time between the last sample of a block and the first sample of the next block is exactly the same as the time between any other successive samples. This makes it easy to combine 100 16,384 arrays of data into a continuous 1,638,400 array of samples, with no gaps.
If you do have gaps of known size (say 100 samples), a not-unreasonable thing to do would be to create an intermediate array of 16,484 samples, with the last 100 being a constant. When you do the FFT, you'll get a spike corresponding to the equally-spaced constant bits, but you can filter this out.
Best, of course, is to get rid of the gaps. Can your hardware do that?
Bob Schor
08-14-2019 02:25 PM
@tecno404 wrote:
I am using redpitaya for data acquisition, its buffer has 16348 samples but I need more to do a high precision FFT ,
Sigh. I need to learn to read the Original Post more carefully! What do you mean by a "high precision FFT"? Do you want a better estimate of the amplitude and phase of a particular frequency, do you want a wider range of frequencies (particularly at the low frequency end), or do you want to distinguish the spectrum difference between two closely spaced frequencies?
If you keep the sampling rate the same and simply lengthen your sample size (say from 16384, 2^14, to 2^18, this will change the low frequency end of your Spectrum.
If you think that your signal is relatively stationary (i.e. the spectrum does not change much as a function of time), you can improve the estimate of your spectrum by taking repeated blocks of 16384 and averaging them. It helps, of course, if they are "adjacent" blocks, as this will give them a known phase with respect to the other blocks.
If your blocks are not adjacent, but you know the spacing accurately, you can use this information to adjust the phase offsets. If you don't know the spacing, you might be able to "work backwards" and, assuming the spectrum remains stationary (or near-stationary), work out what offset value would produce the overall smallest phase shift.
This is an interesting question/problem, and (I hope) it could serve as a "teachable moment" to understand Signals and their Spectra better.
Bob Schor
08-14-2019 03:27 PM
Bob:
Yes, the sampling frequency is the same within a block, I am guessing the spacing between blocks is almost the same, I don't have continuous sampling, it is block by block, I will try the intermediate array.
Thanks for your interest
08-14-2019 03:30 PM
Bob:
thanks for your long email, I want to distinguish between two closed frequencies and I agree with you this is a teachable moment on the FFT and spectrum, very interesting.
Thanks and Best regards
08-14-2019 09:46 PM
Here's a "hand-waving" way to understand how Spectrum is related to Sampling:
Bob Schor