Author |
Topic  |
|
TUMB
8 Posts |
Posted - 27 Jun 2005 : 13:43:05
|
I am trying to filter X, Y and Z Coordinates using DSP ActiveX in VBA. Is there a sample program that I can refer to? Could some one help me accomplish this. T |
|
quinncurtis
1164 Posts |
Posted - 27 Jun 2005 : 13:59:06
|
The Data Analysis ActiveX control does not have any digial filtering routines for 3D data. The digital filtering routines are limited to calculating the FIR filter coefficients for a 2D (time x amplitude) signal. |
 |
|
TUMB
8 Posts |
Posted - 27 Jun 2005 : 14:35:43
|
If I have 2D coordinates, how can I go about filtering the data? Any help would be appreciated. Thanks M |
 |
|
quinncurtis
1164 Posts |
Posted - 27 Jun 2005 : 15:03:06
|
VBA ? Is that Visual Basic for Access ? We weren't aware that the product worked with that environment.
Do you have the manual and the example programs ?
The example DSPDemo has an example of how to setup the parameters for the calculation of a simple 60 Hz low pass FIR filter for a target input datastream sampled at 500 Hz. If you do not know to convolve FIR filter coefficents with your input data stream to produce a filtered output you will need to study DSP textbooks.
The example requires a fixed sample interval corresponding to 500 Hz, or 0.002 samples/second.
nFIRLength = 5 ReDim rFIRFilter(nFIRLength) As Double
For i = 0 To nFIRLength rFIRFilter(i) = 0 Next
rFIRFreq = 500 rFIRHighCutoff = 60 rFIRLowCutoff = 60 nFIRType = FIR_LOWFILTER nFIRDC = FIR_NODC nFIRWindow = RECTANG
DSP1.FIRFrequency = rFIRFreq DSP1.FIRHighCutoff = rFIRHighCutoff DSP1.FIRLowCutoff = rFIRLowCutoff DSP1.FIRLength = nFIRLength DSP1.FIRType = nFIRType DSP1.FIRDc = nFIRDC Call DSP1.FIRSolve Call DSP1.GetFIRCoefVector(rFIRFilter(0))
|
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 09:15:44
|
I am working in Visual Basic for Applications environment. Have added DSP activeX on the form with a name DSP1. Now in the program, I am trying to set the frequency, it is giving me "Object required" error. Is there anything that needs to be done before I start using the activeX? Should I create it first, if so how do I go about doing it?
Thanks a lot for all your help.
M |
 |
|
quinncurtis
1164 Posts |
Posted - 28 Jun 2005 : 09:49:14
|
You have not really made it clear. Do you have a commercial version of the software with the manual and examples programs, or are you just trying to experiment with the demo version of the control ? |
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 09:58:42
|
I have the commercial version with Manuals.
M |
 |
|
quinncurtis
1164 Posts |
Posted - 28 Jun 2005 : 10:10:06
|
Nothing special needs to be done. You should study the example program DspDem and read Chapter 3 of the manual "Programming with the Data Analysis ActiveX Controls". The code that we listed for the FIR filter was extracted from the DspDemo example.
You should only try and access the control during or after the Form_Load event, otherwise it may not have yet been instantiated on the form. |
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 10:43:34
|
Sorry to be bothering you, Where can I find DspDemo example?? It isn't in the manual.
M |
 |
|
quinncurtis
1164 Posts |
Posted - 28 Jun 2005 : 11:27:15
|
The example DspDem is referenced in the manual, under Examples on page 6. The program is found in the QCActX\Analysis\Examples\VB directory.
The example is written for VB 6. That and VB 5 are the only versions of VB that we claim compatibility with.
We have no experience with Visual Basic for Applications. If you cannot get the example to run you will have to assume that it is not compatible. |
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 11:53:09
|
I have a Cd and looks like it doesn't contain the examples, Is it possible to email it to me. Would greatly appreciate that. If it works for VB6, i am assuming it should work for VBA too. I have written several ActiveX in C++ and am using my ActiveX in the current project. Have no trouble doing that. I am assuming it should be OK to use your ActiveX in VBA.
Thanks M |
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 12:22:56
|
I did locate the examples.
M |
 |
|
quinncurtis
1164 Posts |
Posted - 28 Jun 2005 : 12:26:47
|
It is unlikely that the software will work with VBA. Our understanding is that VBA is a scripting language and not a true complier like VB 6. Because of our extensive use of array properties and the memory issues associated with their use, the software does not work with scripting languages. That fact that VBA can use some ActiveX controls does not mean it can use all, or even a majority of them. |
 |
|
TUMB
8 Posts |
Posted - 28 Jun 2005 : 13:29:31
|
THe activeX does work in VBA. Had made a very obvious mistake in referencing. Thanks for all the Help. M |
 |
|
|
Topic  |
|