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

Similar Messages

  • 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

  • Error running MATLAB function on LabVIEW (it works on MATLAB)

    Hello,
    I want to run a game (that I did not write) in LabVIEW which is all programmed using MATLAB. It runs on MATLAB but I have no clue why it does not run on LabVIEW. Please take a look at the attachments to see the error, VI and game.
    Note: I tried running other simpler .m functions that also call outside functions in the same folder using the same VI and they work so it is not the MathScript Node. Also, I already changed the search paths for the MathScript Node therefore the root of the problem is not there either.
    Thank you!!

    Hello,
    When using the MathScript RT Node you should enter your m code into the Node itself.  Have you tried taking your code from the Missile Commander file and putting it in the node?  Are you using any funtions that are on the unsupported list?
    Below are a few resources on getting started with the MathScript Node.
    Getting Started with the MathScript RT Module
    LabVIEW Help: MathScript Node
    MathScript RT Module Functions
    MathScript Functions Not Supported in the LabVIEW Run-Time Engine (MathScript RT Module)
     

  • 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

  • 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 

  • Forcing Mathscript​/Matlab figure window display position

    I know in most cases I can always output the values of my mathscript/Matlab variables through the "add output and an indicator".
    But in some cases I just want the output plot to be generated from Mathscript/Matlab. especially since some MATLAB plot command cannot be output in Labvies
    I have attached two pic files for the block diagram and the plot figure generated. When the plot figure popped up, it is usually at the center of the screen. Is there a way to force the window to pop up say at the uppermost left corner?
    Attachments:
    Matlab _Mathscript Node.jpg ‏53 KB
    plot figure.jpg ‏77 KB

    put the MC_windpos.vi in ...\National Instruments\LabVIEW 8.6\vi.lib\imath\engines\lvmath\Functions
    and us the function windpos as in the attached  example
    Attachments:
    MC_windpos.vi ‏31 KB
    mathwindow.vi ‏26 KB

  • I have a problem with simulation in Matlab 6.5 and LabVIEW for PID controllers

    I have a problem with simulation in Matlab 6.5 and LabVIEW. I have some methods for granting PID controllers in MATLAB to go but not LabVIEW. International Teams degree to transfer two but when I go past the fourth degree no longer work. We changed the formula for calculating the parameters for grade four and gave me some good values for Matlab award but when I put on LabVIEW have not settled. formulas are available in PDF and are. Please help me and me someone if possible. Thanks
    lim.4 generation parameters in MATLAB program and comparison methods are for second-degree transfer function.
    Solved!
    Go to Solution.
    Attachments:
    Pt net.zip ‏2183 KB

    This is the VIs what i try to make,but is not work. This pdf. document was used to create last VIs PID. thenk you for your colaboration.
    Attachments:
    PID create by me.vi ‏312 KB
    tut_3782.pdf ‏75 KB

  • I would like to run Matlab mex file in Labview - how to do this?

    Hello
    In order to run Labview without Matlab beeing installed I have to compile the matlab files, right? So I also want to run those files in Labiew, and I do not know how. Anybody can help.
    Thanks a lot
    kind regards
    Pawel

    Pawel,
    You can create a DLL in Matlab. To compile this DLL you should use both LabVIEW and Matlab typedefs. The Math Works offers a C library with functions for accessing Matlab files. You can use this library to create a DLL. Then import the DLL into LabVIEW by using Call Library Function VI located under Functions>>Advanced palette.
    To call Matlab scripts from within LabVIEW, you have to have Matlab installed on the machine. The Script Node (Matlab script) function is located in Functions>>Mathematics>>Formula palette.
    Here are some useful links:
    - description of those C functions
    [http://www.mathworks.com/access/ helpdesk/help/techdoc/apiref/apiref. shtml]
    - how to download and compile (it will be a little bit different if you want to use CIN)
    [htt
    p://www.mathworks.com/support/ solutions/data/8757.shtml]
    - MAT-file format if you want to develop your own LabVIEW utility to do the job
    [http://www.mathworks.com/access/ helpdesk/help/pdf_doc/matlab/ matfile_format.pdf]
    Hope these suggestions pointed you in the right direction.
    Zvezdana S.
    National Instruments

  • Calling matlab 6.0 from labview

    I need know how to start Matlab 6.0 from Labview, and I will need to pass strings of script commands (for example, a=10;b=5;c=b/a;disp(c)) to Matlab to be executed. And Labview will need to get the result (value of c) back. Thanks for all the help!

    You can use the matlab script funtion under Functions»Mathematics»Formula»MATLAB Script
    Also you can find the matlab script examples in the examples»communication»Importing MATLAB Script.
    I hope this helps... Have fun
    Ogulcan

  • 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

  • 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".

  • Calling Matlab MEX Files in LabView ?

    What is the procedure to call a MATLAB MEX File in Labview?

    Nope Battler.
    I didnt find any help regarding Matlab MEX DLLs on that link by Chris.
    I presume if they are keeping mum, there is no solution possibly.
    Btw, I migrated my testing from LV to MSVC.
    Its a lot more easier to call  Matlab MEX DLLs from MSVC.
    http://www.mathworks.com/support/tech-notes/1600/1605.html

Maybe you are looking for