Is there a way to simulate a notch filter in CVI?

Hi
I am pretty new to CVI.  I've only used it for a course in university. 
I'm wondering if CVI can do things that Matlab can do.  For example, a notch filter is very easily implemented in Matlab. 
Is there a way to create a notch filter in CVI?
Thanks,
Jasmine

Hi Jasmine,
In the CVI Library you should find a Advanced Analysis Library. From there go to Signal Processing»FIR Digital Filters and look for any function that ends in _BSF (Band Stop Filter). These functions will give you the coefficients for a filter and then you would convolve it with your signal to filter the signal. Here's some example code that comes with the  Wind_BSF filter:
/* Design a 55-point bandstop FIR
linear phase filter that can achieve at least a 44 dB attenuation and filter the
incoming signal with the designed filter. */
double x[256], coef[55], y[310],
fs, fl, fh;
n, m, windType;
fs = 1000.0; /* sampling frequency */
fl =
200.0; /* desired lower cutoff frequency */
fh = 300.0; /* desired higher
cutoff frequency */
/* stop band is from 200.0 to 300.0 */
n = 55; /*
filter length */
windType = 3; /* using Hanning window */
m =
256;
Wind_BSF (fs, fl, fh, n, coef, windType);
Convolve (coef, n, x, m,
y); /* Convolve the filter with the signal. */
 I hope this helps!
Tanya V
National Instruments
LabVIEW Platform Product Support Engineer

Similar Messages

  • What does the open file dialog do 'under the hood' and is there a way to simulate it

    What does the open file dialog do 'under the hood' and is there a way to simulate it?
    I have a bug in my code (that I've posted about before, here) which I can't fix at the moment, but I do have a workaround.
    Briefly, the bug:
    I call a dll from a function node, to initialise and run a spectrometer. If I start up the PC, LabVIEW and run my vi the code runs without complaint, the first call to the dll to initialise the spectrometer doesn;t return an error but the spectrometer is not detected either.
    I've tried various solutions, see the link above, and none work
    The workaround:
    If, at any time before running the code containing the function node I open an 'open file' dialog window, select the dll and click ok/hit enter then everything is fine. When I run the main code the spectrometer is detected.
    I use an express vi to open the file dialog, I specify the start path and file name as constant inputs and just click ok/hit return when the dialog pops up. I don't do anything with the dialog outputs. In fact the vi that contains the open file dialog can be run before the project containing the bug is even open.
    I have to do this everytime I turn the PC on.
    So, either
    1) Can somewone suggest a fix for the original bug?
    2) What is the easiest way to simulate the enter keypress when the open file dialog pops up
    or
    3) Can someone tell me what the open file dialog does under the hood that somehow causes the dll to work and can it be simulated in straight LabVIEW
    I suspect that the dll itself is dodgy ( I have in the past talked to the supplier but not got very far, and I will try again but I would like a quick, temporary solution too). I'm guessing that the file dialog is making some kind of check on the file, and possibly registering its presence with the OS (winXP). I tried using the file/folder exists vi to see if checking the file like that worked but no luck.
    Any help greatly appreciated.
    Dave

    Hi David
    I am very conscious about thread hijacking but this sounded like my issue so I hope you dont mind me asking about your issue. I am hoping that you have a spectrometer from the same vendor as me and its not just me seeing an Error 1097 issue. My spectrometer is from a company called Stellarnet.
    So far I have unable to get it to work with other VIs. There is one condition where I can get it to work but its no good for me.
    Case 1
    I open the VI in a fresh labview environment with no other VIs in memory. The code runs with no issue.
    Case 2
    Labview is not opened. I double click the spectrometer VI in windows explorer.  The VI opens but it fails to run resulting in Error 1097. Personally, I dont see the difference between this and Case 1 above and yet it fails.
    Case 3
    If I already have other VI's in memory and try to load the spectrometer VI and run it fails with Error 1097. This case is the one that most important to me. I have a test executive that will load test VIs dynamically and I can't get this to work. Same problem Error 1097.
    I wanted to share what I have seen with you and to let you know that maybe somebody else has the same issue. I am convinced its the DLL but the vendor dis-agreed saying it was LabVIEW. I couldn't convince him otherwise.
    Thanks in advance
    David

  • Hi. Is there any way I can create a filter to see only discussions that I started?

    Hi. Is there any way I can create a filter to see only discussions that I started? I'd like to review questions I've had in the past and the answers to them.
    I recall that an earlier forum UI allowed me to filter on my own discussions. I can't see how to do this with the current UI.
    Thx.
    -Kurt Euler

    If that is possible, you should be able to find it at one of these links
    Jive Help https://forums.adobe.com/docs/DOC-4714
    -or http://docs.jivesoftware.com/jive/7.0/community_user/index.jsp

  • Is there a way to simulate pressure sensitivity with a mouse?

    I dont have a tablet, so is there any way I can make strokes with my mouse that look like they were made with a pressure sensitive pen? (thinner edges, thicker middle)

    You can use Stroke Path with Pen Pressure enabled is one way.
    What version of photoshop are you using?

  • Line 21 CC in DVD Studio Pro...is there a way to simulate before burn?

    Hey all I had a question about closed captioning for a DVD I am producing for a client. We had some TV Spots closed captioned and now the client wants these closed captioned videos on a playable DVD, so they can share them with others (not for broadcast purposes). Our company sent out to get the CC done and they sent as back an .mov that has CC and an .scc file to be used in DVD Studio Pro. I imported the .mov into DVD SP as my asset and on the track timeline i right clicked and added the Line 21 file. But I was wondering if there is any way to check and test to see if this works before I actually burn a dvd. I want to make sure the CC is synced up and working before i start burning 200 copies of this thing and it's important to the client that the CC is working. Does anyone know how to simulate the CC or Subtitles for a Line 21 file?
    -Mike

    You DO NOT need to burn a copy of the DVD just to test it.
    BTW - If the MOV file has the cc already inserted, you may not need to use the .scc file..
    1. Leave the scc file out of the project and simply BUILD the DVD to you HDD. Use DVD Player to test the DVD build with Closed Captions turned on. In DVD Player v5, the option is under the "Features" menu. In DVD Player v4, the option is under the "Controls" menu.
    If the captions were encoded properly in the mov file, then they should now be displayed by DVD Player.
    2. Using Compressor, create m2v & ac3 files from the mov, and use those for the Track in DVDSP. Build the DVD, and test for cc as outlined previously.
    3. If you still don't have cc displayed, attach the scc file to the track, build the DVD (using m2v/ac3 files) and test with DVD Player.
    The cc should be displayed in DVD Player unless there was a problem with the scc file, which should have resulted in an error/warning message in the build log.
    I highly recommend using files generated by Compressor, as (in my experience) audio will badly drift when mov files are converted to DVD mpeg2 format in DVDSP. Besides, you will have much more control of the conversion, and better results from compressor generated files. Also, a rebuild with m2v/ac3 files will only take a couple minutes as opposed to several hours when using an mov.
    Good luck

  • Is there a way to simulate a mouse click anywhere on a screen in Dictate ?

    I'm using Dictate because of hand problems. Unfortunately, it does not seem to have the ability as supplied to simulate mouse clicks anywhere on the screen as Dragon Naturally Speaking does on the Windows side.( I do not mean by this the ability to select an item in the menu, which It does have the built in ability to do.) It can, however, so I read, be scripted to do a lot of things. Is there an Applescript out there that would allow for the simulation of mouse clicks anywhere on the screen (as opposed to just on a UI item)?

    Platform: 2.2 gHz iMac using Mac OS X 10.5.5; Dictate v. 1.2.1 Build
    Okay, so, here, after a great deal of research, is a procedure for implementing a single mouse click anywhere on the screen. Since it’s a procedure, I’m detailing each step.
    !. Download the scripting addition (sometimes known as an OSAX) xTool.sax from: http://lestang.org/osax/XTool/XTool-2.0.dmg.tgz. You will have to decompress the file (StuffIt) and double-click it to get it to unfold into a .dmg (disk image) file. In this file you will find the file Xtool.osax. Drag it into your MacHD (or whatever the name of your topmost volume is)/library/ScriptingAdditions (no spaces in the name) folder. The purpose of this is to place it into a folder where Applescript is expecting to find scripting additions. In other words, it’s hard-coded and you can’t just drop it anywhere because Applescript may not find it. Also, there may be more than one Library folder in other directories. Under 10.5.5. which I’m running, I can tell you it works where I placed it.
    The effect all of this has is that when you create your script in Dictate’s New Commands window (Script Editor), Dictate will know what the commands “click mouse’ and “position of the mouse” mean. These are not standard Applsecript commands but are additions, hence the name Scripting Additions.
    2. Start Dictate and in the File drop-down select New Command. This will take you to a window with a pane on the left with names such as Applications, Global, and several others. Click on Global (so that the command will be recognized no matter what application your are in). To the right of the pane you will see a number of commands listed by name and, underneath, a (very small) “+” (and a minus sign and a small icon). Ignore everything but the “+”. Click on the “+”.
    Below several boxes will appear: Command, Description, Context, Type.
    In Command Name type in the name you want Dictate to recognize to do the click. (I call mine Mouse click.) In Description you can type something like Single-clciks the mouse. In the Context drop-down make sure to select Global. In the Type drop-down, select Applescript.
    Paste the following into Text Edit (orTexEdit Plus,if you have that):
    click mouse {(position of the mouse), [1]}
    For reasons unknown to me, you can’t just select that text, copy, and paste it into Dictate’s Script Editor winodw. You will have to select it in Text Edit and drag it into the Source text box.
    Click on the Compile button at the left bottom. After it finishes compiling (a matter of seconds if everything is normal), click on the Run button with your mouse. If all has gone well, you will very likely see the Run button get pressed repeatedly. Take your mouse off the button so it stops blinking like mad. (The Mouse click Appplescript is repeatedly looking at the position it find itself and clicking again, and again.)
    While your mileage may vary, I have been able to simulate single mouse-click using this workaround.
    So far, I have not been able to simulate a double-click reliably. There is, I believe, an issue with the amount of time between the two clicks (a parameter of the click mouse command above which I did not go into here). For anyone out there who wants to work on that, I would be glad to hear your results. I’ve tried values up to 2000 in the DELAY parameter after the TIMES parm. Here is what the dictionary shows for this command.
    click mouse?v
    click mouse [point] : where to do the mouse click
    [times integer] : how many times you want to clik the mouse
    [delay integer] : delay between two mouse clicks
    [using primary button/secondary button/middle button] : which mouse button
    If I get this to work I will let my fellow sufferers know.
    Thanks to Hiroto and Andrew99 in particular for their help.

  • Is there a way to simulate the look of a (Linux) shell program

    I'm working on a program that teaches users Linux commands. I want to simmulate the shell prompt look and feel but actions won't have any consequences. It'll be like a hands on tutorial. Any help?

    http://www.javootoo.com/

  • Is there a way to fade in the exstrude filter?

    Hey Guys
    Is there a way to let the exstrude filter fade in ?
    Iam using the form writting on effect for an project and i need that after the writing effect the exstrude filter fades in slowly is there a way to do it?
    Iam using
    = Behavior/Form/Write on
    =Filter/sterilise/Exstrude
    Thanks for the help
    Nils

    hi
    one way to do it, is to clone your text layer, have that write on and fade it off, at the same time as this layer fades off, fade on your text layer with the extrude.
    hth
    adam

  • How to design a good 60Hz notch filter?

    I tried to design a 60Hz notch filter(59-61 as stop band,tried different kind filters/orders,cont.true)But I can't have a stable output. When test on 60 Hz input,the output signal's amplitude will change in a repeated pattern,sometime the ripples is very small, but sometimes it's big, especially at the waveform beginning. The Fs is 5000, data is sampled every few seconds. Are there any refined 60Hz notch filter can be used, or any better way to design a notch filter?
    Averaging is one way to remove the ripples after filtering,but I hope the filter can give a steady output.Thanks!

    sfhj wrote:
     please if you have this example  or know about it ,send it 
    thanks
    @sfhj
    Hijacking a old thread is never a good idea. I suggest you start your own. Also in order to get help you must explain better what you have done so far, why and how you struggle. The best way to do this, is to post your code, and some signals examples. I know a lot of tricks. And none of them need a fancy toolkit. But you must start your own thread in order to get help from me.  
    Edit: I noticed you have started a new thread, do you want to move the discussion to that thread?
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Is there a way to test for network connectivity (and a way to simulate it)

    Is there a way to test for network connectivity, which API to look into? Also, is there a way to test that code in the simulator, that is, to turn off the network in the simulator.
    Thanks

    A peek in the docs would help- there is a TON of information there.
    You might also try the Reachability sample app for ideas:
    http://developer.apple.com/iphone/library/samplecode/Reachability/index.html

  • Is there any way to create a shadow in both sides of a box?

    Hi,
    is there any way to create a shadow in both sides (opposite) of a box? I just can create the shadow in one side..
    If not, is that possible in CS6?
    CS5.
    Regards

    You can definitely show an inner shadow on just one side of a rectangle.  You just need to turn the blur down to 0 to prevent it from leaking to the nearby sides.  Then set the angle to an exact multiple of 90, like 270 to put the shadow on the top side of the rect.
    This file has some examples: http://johndunning.com/fireworks/scratch/Shadowed%20Elements.png
    If you're trying to simulate a rectangle with different border colors or widths, this auto shape can make that easy: http://johndunning.com/fireworks/about/MultiBorderRect

  • Is there a way to tell what settings were used to export a PDF?

    Is there any way to tell what export settings were used to create a PDF? I'm trying to recreate settings used in a previous PDF.

    Most of which are controlled by the Export options used;
    Description
        KK Stevens
    PDF Preset: CC to PDF for KKSPC-Flattened
    Compatibility: Acrobat 4 (PDF 1.3)
    Standards Compliance: None
    General
        Pages: All
        Spreads: Off
        Generate Thumbnails: On
        Optimize PDF: Off
        Create Acrobat Layers: N/A
        Export Layers: Visible and Printable Layers
        Include Bookmarks: Off
        Include Hyperlinks: Off
        Export Nonprinting Objects: Off
        Export Visible Guides and Baseline Grids: Off
        Create Tagged PDF: Off
        Interactive Elements: Do Not Include
    Compression
        Color Images
            Bicubic Downsample at: 300 ppi
            for images above: 300 ppi
            Compression: ZIP
            Tile Size: N/A
            Quality: 8 Bit
        Grayscale Images
            Bicubic Downsample at: 300 ppi
            for images above: 300 ppi
            Compression: ZIP
            Tile Size: N/A
            Quality: 8 Bit
        Monochrome Images
            Downsample at: 1200 ppi
            for images above: 1200 ppi
            Compression: CCITT Group 4
        Compress Text and Line Art: On
        Crop Image Data to Frames: On
    Marks and Bleeds
        Crop Marks: Off
        Bleed Marks: Off
        Registration Marks: Off
        Color Bars: Off
        Page Information: Off
        Page Mark Type: Default
        Weight: 0.125 pt
        Offset: 0.125 in
        Use Document Bleed Settings: Off
        Bleed Top: 0.125 in
        Bleed Bottom: 0.125 in
        Bleed Left: 0.125 in
        Bleed Right: 0.125 in
        Include Slug Area: Off
    Output
        Color Conversion: No Color Conversion
        Destination: N/A
        Profile Inclusion Policy: Don't Include Profiles
        Simulate Overprint: Off
        Output Intent Profile Name: N/A
        Output Condition: N/A
        Output Condition Identifier: N/A
        Registry Name: N/A
    Advanced
        Subset Fonts Below: 1%
        Omit PDF: Off
        Omit EPS: Off
        Omit Bitmap Images: Off
        Transparency Flattener Preset: [High Resolution]
        Ignore Spread Overrides: Off
    Warnings

  • JDBC & setQueryTimeout - or is there another way to set query timeout?

    I am trying to set query timeout for TimesTen using jdbc library. But it seems like TimesTen jdbc library does not support setQueryTimeOut. Is there a way to set it without having to set it statically in the DNS?
    I tried to set the SqlQueryTimeout in the connection string but it doesn't work either:
         Connection connection = DriverManager.getConnection(
         "jdbc:timesten:client:TTC_SERVER=bleh;TCP_PORT=17013;TTC_Server_DSN=blah;TTC_Timeout=0;SqlQueryTimeout=5;");
    Thanks for your help!

    Thanks for replying. I don't know have good knowledge on Cache Connect. I will have to read on that first.
    It seems like TimesTen does not support jdbc setQueryTimeout. Calling this method on TimesTen jdbc library will return false: supportsQueryTimeout().
    I created a test class for testing the SqlQueryTimeout. I set the TTC_Timeout to 400 seconds and SqlQueryTimeOut to 5 seconds. So after 5 seconds it should time out.
    The way I test it is by putting a break point before executing the query, do a route add DBServer to an un-connectible gateway to simulate the network delay/connection problem and then continue after I added the route.
    After executing the query, instead of timing out after 5 second, it will wait for a few minutes before timing out.
    The code for testing the timeout is as follow:
    public class TTTest {
         public static void main(String[] args) throws ClassNotFoundException {
         Class.forName("com.timesten.jdbc.TimesTenDriver");
         try {
         Connection connection = DriverManager.getConnection(
         "jdbc:timesten:client:TTC_SERVER=server;TCP_PORT=17013;TTC_Server_DSN=server_dns;"
         + "TTC_Timeout=400;SqlQueryTimeout=5;");
         System.out.println(connection.getClass().getName());          
         Statement stmt = connection.createStatement();
         //com.timesten.jdbc.JdbcOdbcStatement stmt = (JdbcOdbcStatement)connection.createStatement();     
         System.out.println(stmt.getClass().getName());
         System.out.println("Query started " + new Date());
    // Pause here, put a route add and continue
         ResultSet rs = stmt.executeQuery("select count(*) from mse");
         rs.next();
         System.out.println("there are " + rs.getInt(1) + " rows");
         rs.close();
         stmt.close();
         connection.close();          
         } catch (Exception x) {           
         x.printStackTrace(System.err);
         System.err.println(new Date());
    }

  • What happened to my iPhoto albums/events?  is there a way to retrieve them?

    I know that iPhoto no longer exists, and i migrated my photos to Photos, but the albums/events that I spent years creating are gone!  Is there a way to retrieve them?

    Moments in Photo are the new Events, i.e. groupings of photos sorted by date taken.
    When the iPhoto Library was first migrated to Photos there was a folder created in the sidebar titled iPhoto Events and all migrated iPhoto Events (which are now Moments) are represented by an album in that folder. To open the sidebar if it's not already open use the Option+Command+S key combination.
    There's a way to simulate events in Photos.
    When new photos are imported into the Photos library go to the Last Import smart album, select all the photos and use the File ➙ New Album menu option or use the key combination Command+N.  Name it as desired.  It will appear just above the iPhoto Events folder where you can drag it into the iPhoto Events folder
    When you click on the iPhoto Events folder you'll get a simulated iPhoto Events window.
    The downside to the simulation is that the Album/Events can only be sorted automatically by Title. But they can also be sorted manually, either in the sidebar or in the folder's window at the right.
    Ask Apple for more sorting options in Photos via https://www.apple.com/feedback/photos.html.

  • Is there a way to use a DAQ VI without DAQ hardware?

    Hello,
    Is there a way to use a DAQ VI without having DAQ hardware?
    Thanks,
    Steve

    Steve,
    Yes, you can use the DAQ VIs without the hardware. With the DAQmx 7.5 and 7.4 version of the driver, you can simulate DAQmx devices. This will save you some time, as you can program and test your application without the actual HW present. However, you will not have the full functionality with simulated devices.
    Regards,
    Somendra

Maybe you are looking for

  • HT4623 how do i update the app store app on my iphone?

    Unfortunately for the last couple of days; when I've stepped into my App Store app and type in an app to download, the screen stays blank. Actually literally EVERY screen within the app store is unresponsive. I do have an iPhone 4S with an underlined

  • Can't get FCKeditorAPI to load to validate HTML Editor contents

    I have an HTML Editor item on my page and wanted to quickly check the length of the text in the editor before submitting the page. It should be possible to get the contents of the HTML Editor using the FCKeditorAPI, but I can't get it to load. I'm do

  • Having problem with my app on the Iphone 4

    i recently buy an iphone 4 but lately i been having problem with all app on the iphone i can't enter app store, facebook, tweeter etc and when i try to log off my account it actually don't let me log off i even do a recent to the iphone 4 and yet not

  • (Adobe) Serial Number doesn't work, please advise

    Hi, I just bought ColdFusion Builder which includes FB as part of the $299 purchase price.   When I paste the serial number into the Flash Builder Burrito Trial, it says "This serial number is not valid for this product.".   Please advise,   thanks.

  • Belkin tunetalk stereo with classic?

    I am having a weird problem with Belikin Tunetalk stereo & IPOD classics. I've asked Belkin & Apple & had nothing useful. Anyone add anything? background: Been using Belkin tunetalk stereos (2) with 2 Ipod 5G (video) for more than a year. They work o