LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resample in MASM not working properly - possible bug?

Solved!
Go to solution

NI_MASM_SigOPEration.lvlib:Resample (constant to constant (multi-channel, DBL).vi

Array size out doesn't seem to be what I'd expect. MatLAB produces the same size in for the same size out, so possibly the FIR params are wrong (but they are default) so there is a problem here as the array size out is missing columns:

85 to be precise whatever I set the end sampling rate to, it culls it. 

Resample_why_85.png

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 4
(925 Views)

I don't have that toolkit, but as a more general question:

 

Why do you expect that resampling at a lower sample rate should leave you with the same # samples you started with?   Let's suppose you sampled a bunch of channels at 1000 Hz for 2 seconds to produce your 2000 columns.  Then you want to resample down to, I dunno, say 50 Hz.  I for one would expect 2 seconds worth of samples at 50 Hz, i.e., 100 output samples per channel.  Not 2000.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(889 Views)
Solution
Accepted by topic author James_W

Needs padding with Zeros see 
C:\Program Files\National Instruments\LabVIEW 2020\examples\Signal Processing\Waveform Conditioning\Constant-to-Constant Resampling.vi
for example of how to di this with a 1d array

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 4
(858 Views)

@Kevin_Price wrote:

I don't have that toolkit, but as a more general question:

 

Why do you expect that resampling at a lower sample rate should leave you with the same # samples you started with?   Let's suppose you sampled a bunch of channels at 1000 Hz for 2 seconds to produce your 2000 columns.  Then you want to resample down to, I dunno, say 50 Hz.  I for one would expect 2 seconds worth of samples at 50 Hz, i.e., 100 output samples per channel.  Not 2000.

 

 

-Kevin P



Number of columns is exactly my Sample Frequency, so I expect resampling to give me the new Sampling frequency #of columns.
(standard Resample function produces the same array sizes).

Should be nice and simple to test 😉

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 4 of 4
(855 Views)