MathScript fir1 function vs. LabVIEW FIR VI

Hi, I'd like to convert some Matlab/LabVIEW Mathscript function into LabVIEW block functions, because it's faster.
One
of the function I'm not sure is the FIR function: I have a Mathscrip
function fir1(n,W), is "FIR windowed coefficients" its LabVIEW
equivalent?  If yes, how should I match the parameters (e.g. is W the
high or low curoff frequency? is Order n the same as the number of
taps)? If no, which LabVIEW function should I use?
Thanks.

Hi,
The corresponding VI in LabVIEW is FIR Windowed Coefficients VI. For the simple case b = fir1(n, w), you can use the way as the attached snapshot illustrates.
Attachments:
fir1.PNG ‏7 KB

Similar Messages

  • How to create a filter using mathscript transfer function in labview

    Dear all,
    I am currently designing a filter in labview using a Mathscript looping. The filter can be represented in transfer function. I have attachted the transfer function equation together with its value and the desire frequency vs. amplitude graph that I should obtained from it. Also, following are the transfer function written in Matlab.
    B1= tf ([57.5221845],[1 51.017077 205.1868]);
    B2 = tf ([1 0],[7.6991]);
    B3 = tf ([1 0],[14.32433403]);
    B4 = tf ([1 0],[137.6017]);
    F = B1 * ( (1+B3)/((1+B2)*(1+B4)));
    plot(F)
    I have also modify the coding as Labview Mathscript does not support the Matlab coding "tf" as transfer function to "bilinear"
    Problem I am facing are:
    1) Unable to display the graph of the filter in labvie.
    2) Unable to have sinewave as an input to the filter.
    3) The output cannot be display in graph format. 
    Hope to have the soonest reply from you guys. Many thanks in advance 
    Solved!
    Go to Solution.
    Attachments:
    transfer function.jpg ‏18 KB
    Weighting Filter.vi ‏266 KB

    Thank you again for offering to help me in writing the code.
    I suppose that I should do a frequency sweep on the transfer
    function to prove that it behave as the sample graph. Example, if I have an input sine
    wave with the frequency of 8.8Hz passing through the transfer function filter, the
    output that I should be getting is 1 according to the transfer function graph
    and of cause the frequency range of my input sine wave would only be between
    the ranges of 0.5 Hz to 30 Hz.
    Attachments:
    Weighting FilterTest1.vi ‏53 KB

  • Mathscript​/Matlab fir1 function vs. LabVIEW FIR coefficien​t?

    I'd like to convert some Matlab/LabVIEW Mathscript function into LabVIEW block functions, because it's faster.
    One of the function I'm not sure is the FIR function: I have a Mathscrip function fir1(n,W), is "FIR windowed coefficients" its LabVIEW equivalent?  If yes, how should I match the parameters (e.g. is W the high or low curoff frequency? is Order n the same as the number of taps)? If no, which LabVIEW function should I use?
    Thanks.

    Hi pji,
    I don't have LabVIEW, but I found some really useful resources in LabVIEW Help (open labVIEW>>Help>>search the LabVIEW Help>>search)
    Search for fir1 and it contains the syntax, paramter definition and some example codes which you can simply copy and paste and run
    b = fir1(n, w)
    n: Specifies the filter order. n is a nonnegative integer.
    n must be even for filters with a non-zero gain at the Nyquist
    frequency. If n does not meet this condition, LabVIEW increases
    n by 1.
    w: Specifies the cutoff frequency of the filter. w is real number
    between 0 and 1. 1 represents the Nyquist frequency.LabVIEW Help has abundant information, check it out!!!
    Van L
    NI Applications Engineer

  • MIDI Read function in LabVIEW 8.2

    Is there a MIDI read function in LabVIEW 8.2?

    http://forums.ni.com/ni/board/message?board.id=170&message.id=280480#M280480
    You could have aksed it in your previous post since it concerns the same functions.
    André
    Message Edited by andre.buurman@carya on 10-26-2007 09:12 AM
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Register a Callback function in LabVIEW

    Is there any way to register a callback function in LabVIEW. For example:
    I have a DLL on Win2k that run a thread. This thread is doing a certain task (it is not important what it does...) I can't predict when this task will end and I need to know when the task is over. The easy way would be to poll this DLL and ask: "Is it over? Is it over?" over and over again. No! I don't want to poll. Not because it's too easy. I want this DLL to wake me up on time.
    Any idea, solutions, function that I'm not aware of, new features...
    Thanks
    Nitrof

    I think I have a much better solution for you. Here is an example program that show how to set a LabVIEW occurence in a dll. Therefore when your dll is done it can set the LabVIEW occurence, meanwhile your VI is just waiting on the occurence.
    More infomration on this is in the external code in LabVIEW manual Using External Code in LabVIEW
    NOTE:This will ONLY work in LabVIEW 7.
    Attachments:
    SetOccurDll.zip ‏165 KB

  • Different output of DST function in labview and matlab

    I am passing a 1D array of size 1550 as input to DST function. I have also calculated DST of same array in matlab using 'dst' function. I got approximately same answer till 1399th element but after that answers of two varies abruptly. I tried hard but I am unable to find the solution. I am attaching the data file in which it can be clearly seen that at 1530th element there is a difference of sign also.
    Attachments:
    data file1.txt ‏37 KB

    Out of curiosity, have you tried another software, like Octave? When you have two software that is different, which one is incorrect?
    Also, have you tried to use the DST function in LabVIEW directly?
    Another think to keep in mind... When you try to run a sequence for so long, small round-off errors could be cummulative and show later on the analysis. Also, it depends on how you load the data into each software. Hopefully when moving the platforms, the string conversion would not truncate the number. The best is not using string, but some kind of binary format...
    These are some ideas to check...
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • Functions in labview

    Hy,
    I've got a question concerning functions in Labview.
    Is it possible to see the *source* of a function ?
    I'm working with the "Butterworth filter" and I need to know how it
    works *in the inside* :]
    Thank,
    Maura

    On Sat, 10 Jul 1999 23:19:29 GMT, Greg McKaskle
    wrote:
    >> I've got a question concerning functions in Labview.
    >> Is it possible to see the *source* of a function ?
    >> I'm working with the "Butterworth filter" and I need to know how it
    >> works *in the inside* :]
    >>
    >
    >The majority of the simple DSP functions are, to my understanding,
    >taken from the Numerical Recipes in C textbook. If you can get
    >your hands on a copy of that book, it will probably be the same,
    >or at least a very similar implementation.
    >
    >Greg McKaskle
    Thanks a lor for the info.
    So there is no way to get the algorithm directly from labview?

  • I am trying to call a function with LABVIEW developed in CCS compiler

    I used MPLAB (CCS compiler) to develop c code that is used to transmit and receive messages to and from an automotive display. It works great as a stand alone. I would like to call this function from LABVIEW but am having difficulty doing so. Does anyone have experience calling a MPLAB developed project from LABVIEW? Thanks in advance.
    Matt

    PTE wrote:
    I used MPLAB (CCS compiler) to develop c code that is used to transmit and receive messages to and from an automotive display. It works great as a stand alone. I would like to call this function from LABVIEW but am having difficulty doing so. Does anyone have experience calling a MPLAB developed project from LABVIEW? Thanks in advance.
    Matt
    MPLab is for programming PICs if I'm not mistaken. I'm not sure how you would want to call a function compiled in MPLab from LabVIEW directly. MPLab will create binary code for execution on PICs and there is no LabVIEW that could run on a PIC. On the other hand I didn't think you could create standard Windows DLLs, Mac shared libraries or similar in MPLab at all.
    You will have to recompile your code in a C compiler that can create the standard shared library format for the plaform you want to call it from LabVIEW.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can i call winmain function in labview

    hello everyone,
    Well i have written a C++ code that uses the  winmain function (windows function). i want to convert this code into dll and call that dll into labview.
    Is it possible to  call winmain function as one of the functions in labview. Please let me know as soon as possible.
    Thank you.
    Royal  tiger......

    You didn't say what development environment you're using, so I'm assuming Visual Studio. It sounds like you created a Win32 app (as opposed to an MFC app). This has a "WinMain" function. The prototype for WinMain is geared towards it being called by the OS when you run the executable. You could just add the __declspec(export) directive in front of the return type, but you also need to change some build functions in Visual Studio to get a DLL. You probably also don't need all the arguments that WinMain uses. You're probably better off by starting with a new DLL project in order to get the framework for a DLL, and then copy and past the function code. That's what I would do.
    I would also strongly suggest that you crack open the "Using External Code in LabVIEW" manual that gets installed when you installed LabVIEW. It's in the "manuals" directory, filename of "lvexcode.pdf".

  • Problems of integrating Matlab functions in Labview

    Hi,
    Does anyone know how to completely integrate Matlab functions into Labview program without a copy of Matlab in the system when I run the entire program?
    Initially I used 'Mathscrip' node but I heard that it doesn't support Matlab toolbox.  Thus, I tried out the other option 'Matlab script' node. This node works well in implementing Matlab functions but it indeed requires Matlab installed in the system. 
    So in other words, how could I realize the full integration(as what Matlab script node achieves.)  without Matlab installed in the system?   
    Cheers,
    Nicholas 

    hi smercurio,
    So you mean that the Matlab script is no longer necessary in my case right?
    Could I just ask my colleague to compile his codes to matlab dll and I use the Call Library Function Node  instead of Matlab script to call it?
    About MCR, is it the correct source at the following link  http://www.mathworks.com/matlabcentral/fileexchange/5268 ?
    Sorry for those basic queries in Matlab as I have very little experience in it. lol... thanks a lot.
    Cheers,
    Nicholas 

  • Where can i find the FFT functions in Labview 7.1 Express

    Can anybody tell me where i can find the FFT functions in Labview 7.1 Express or what i have to install??
    regards
    Acosmo

    Hello Acosmo,
    You can find them under
    All functions - Analyse - Signal processing - Frequency domain.
    It's maybe easier if you do a search: when you right click on the block diagram, you have a seach option, just write there FFT and you will have them there.
    Hope it helps,
    Paulo

  • Can not find size_t during import a dll and calling a function crash labview

    Hello, experts
    I need to use FingerLakeInstrument  DLL ( see the attached) inside Labview to talk to a CCD camera. it is built from microsoft visual studio C++
    I unzip FLI dll in my D:\proj\...\linfli-32 and import dll from there. created a c:\FLIDBG.txt as FLI dll needs to write debug message to it if FLISetDebugLevel() or others are called.
    During importing the dll, first thing I got is <sys/types.h>  ( ie size_t ) cannot be found. I have installed free version of microsoft visual studio C++
    but can not find "typedef unsigned int size_t"
    at the end, I just added
     typedef unsigned int size_t;
    in the libfli.h. Having done that, I am able to import all functions into Labview and have a user library called libfli.
    However, as soon as I start calling a simple function in a test.vi, such as FLIGetLibVersion(char* ver, size_t len), which involves nothing other than the library, the labview will crash.
    I created a simple C test.exe which calls many functions without any problem
    any suggstion?
    regards
    xiaofeng
    Solved!
    Go to Solution.
    Attachments:
    libfli-32.zip ‏93 KB

    Hi, Smercurio_fc
    thanks for your reply. Yes, you are pointing to the right place.  I have solved the crash problem.
    when importing DLL into Labview using Tools\import\Shared Library (.dll), Labview automatically set the calling convention as C not as stdcall (WINAPI).  it is this that later the labview crashes when a function is called.  as soon as I manually re-selecte calling convention as stdcall, my test.vi works OK (see attached).
    I tried Call Library Function too to call libfli.dll, as long as I select stdcall as call convetion. the test.vi works.
    How do I know which Call convention I need to choose if  there is no infomation from DLL provider?
    as for the size_t,
    I add   #include <crtdefs.h> in libfli.h and 
     add additional include path as
    C:\Program Files\Microsoft Visual Studio 10.0\VC\include.  this  solved the "not found" issue.
    for this case I know that the DLL is built from VC++,  is this right way? 
    again, thanks for your time.
    xiaofeng
    Attachments:
    test.vi ‏13 KB

  • Labview Dll call library function Causing Labview to unload

    I am trying to use the Call Library function in Labview 7.1 to call an Init function for a Zathic Can4USB device. When I run the vi, it complete log LabView out of the computer. Can anyone tell me why the function totally unloads LV without displaying an error?
    Thanks

    Either the function has a serious bug or you are calling it with
    invalid parameters or wrongly setup parameters. The problem happening
    here is that your DLL passes somehow invlid parameters to a system
    device driver and that driver causes a protection fault. For device
    driver execeptions which happen in the privileged kernel, Windows does
    not try to attempt to message a user in such cases (other than the
    threaded blue screen of dead which when you get it really means a full
    restart) but unloads the current application as fast as possible.
    Check the documentation for this function and try to see where you call
    it srong or contact the developer of this DLL for assitence.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Mathscript psd function - needs replacement

    Is anyone aware that the Mathscript PSD function doesn't really output a power spectral density?  I believe this PSD function is the same as the now unsupported Matlab PSD function.  For additional information, please see this website: 
    http://www.mathworks.com/support/solutions/data/1-17M11.html?solution=1-17M11
    It appears to be a fairly simple manner to fix the units.  If I divide the output of the Mathscript PSD function by half the sampling frequency, I appear to get the right units of Pa^2/Hz (the units in my application).  Does anyone have any comments on this?

    Hi hprd,
    Thank you for your feedback.  This was reported to R&D (# 4H7ETOSF) for further investigation.
    Donovan

  • Mathscript griddata function is very slow in Labview 8.6

    I'm using the griddata function in Mathscript as a direct replacement of a Matlab function we were using in the past.
    I discovered a bug with griddata which was fixed in Labview 8.5. The funciton executed very well in that version.
    I've upgraded the code to LV8.6, and now when executing griddata on the same data set in either 'linear' or 'cubic' mode, the function is MUCH slower than when using 'v4' or 'nearest'. All four methods had the same execution time in LV8.5.1
    I have searched many topics covering issues with griddata and 'cubic', but I'm pretty sure this is a new bug. 
    I've attached a VI containing my data set. Running this VI in 8.5.1 and using 'linear' mode is much faster than in 8.6.
    I'll be going back to Matlab, since the rest of the code has already been upgraded to 8.6 and this makes regression it unusable for my purposes.
    Any ideas?
    Thanks.
    Attachments:
    no_Matlab_griddata_example.vi ‏94 KB

    I should correct one detail in my message. The girddata bug was originally fixed for 8.5.1, not 8.5, per the following CAR: 41OHD4VQ
    The attached VI should be run in 8.5.1 and then in 8.6 ('linear' method) to see the performance decrease.

Maybe you are looking for

  • Mixing ram whats best

    hi im currently running 3 1gb sticks of ram but one of the sticks is older than the others and only runs at 533mhz the others usally run at 800mhz but because of the older stick all sticks run at 533mhz. my question is. is it better to run 3gb of ram

  • JMS proxy and XA connection factory

    Hi all, I would like to ask you what is the best practice to adopt about the scenario described below. A JMS proxy retrieves a message and processes it. Any error could occurr during processing it and, in case of errors, the JMS proxy error handler p

  • Error while installing ifrs starterkit for nw

    I just installed the ifrs starter kit as mentioned in the installation document troughh bw. it has been installed with errors relating the following dimensions: INTERCO,RPTCURRENCY and OWNACCOUNT. Invalid attribute name (MBR__SEQ) in dimension (INTER

  • Restricting alphabets in x:inputCalendar

    Hi, I'm using x:inputCalendar for the date fields. But I'm able to enter aplhabets into this field. Is there any way of restricting this from the front end? Regards, Santy

  • IWeb photo sizing

    I tried to get some specifics from the iWeb help menu but did not find the info. I will be publishing my business site shortly and will have at least one page with slide show - probably 15 photographs. What are the photo dimensions, file size, and fi