Goertzel Algorithm Implementation For Fast DFT Of A Few Bands?

Jul 24, 2009

I'm working on an application where I need to analyze a sampled wave for the presence and power level of a handful (6 for now) of specific frequencies. For the last several weeks I've been reading up on FFT, and even implemented a .NET FFT algorithm by translating over some VB 6 code I found. Unfortunately, I don't think that the code I translated is working, because it only gives me 150 some elements. (My array of samples has 512 elements, so after FFT, I should have 256, right?) I've tried to debug it, but because I don't understand the math behind it, it's been difficult.

I came to realize that the Goertzel algorithm may be better for my application. I understand it as a fast way to get the power level of a specific band found in the result of a DFT, without all the math necessary for DFT or FFT, simplifying the problem, and saving a lot of CPU cycles all at the same time.On that site there is some sample code for implementation:

Code:
realW = 2.0*cos(2.0*pi*k/N);
imagW = sin(2.0*pi*k/N);

[code]....

Note that in that code, eventually I intend to be able to pass a frequency in Hz, and the current sample rate, but for now, the freq parameter is just what band I want, and samplerate is ignored. In my current FFT, I get values from 0 to 1, but with this code they can be as high as hundreds of millions.

View 10 Replies


ADVERTISEMENT

VS 2008 Singleton Factory Implementation - Is Pattern Implementation Right

Mar 18, 2010

So I've been doing some research on the singleton factory design pattern, and I am wondering if my example implementation is correct (warning I did get carried away creating animals):

[Code]...

View 6 Replies

Add-on (tool Bands) For IE

Aug 21, 2011

i read this guide [URL] and I added it successfully to my IE browser... Now I have one problem - creating a DLL for it (extension) where i need to start?

View 3 Replies

Loop Through Datagridview By Bands And Insert Records To Database?

Nov 23, 2010

I choose an item from dgrpoducts which has all the products in inventory and it sends the selected items to another datagridivew called dgiselectedproducts. These are the selected items.

View 5 Replies

Implement An Algorithm Called "Diamond-Square Algorithm"?

Jun 8, 2009

I am trying to implement an Algorithm called "Diamond-Square Algorithm" I am having trouble ending it so that it retiurns the required result. So far I have the folloiwng.

[Code]...

View 3 Replies

Bad Implementation Of IDisposable?

Oct 20, 2009

I am a budding MCTS so I am not a 100% sure of whether I am correct in this instance.I am looking through a windows forms application created by a developer who has left our company some time ago. Within the code I have found a custom form derived from the standard form baseclass which explicity implements IDisposable.The custom form does not call any COM object or do any file IO operations and has only one database call which is closed and disposed off in the method that calls it. However within the code of the form there is the following,[code].....

Looking at this am I right in thinking that this should be removed including the implements IDisposable line at the top of the form since,

1. The listeners collection will go out of scope when the form does as the collection only references listener objects (which do not implement IDisposable).

2. The controls do not explicitly need disposing, since when the form goes out of scope this will be done anyway.

View 4 Replies

Implementation Of C++ Code In .net ?

Aug 20, 2009

I have developed a C++ program code .Now, I want to access this code in VB.net .

View 2 Replies

.net - IBindableComponent Interface Implementation ?

Jan 19, 2011

I need to implement the IBindableComponent to the the following code:

Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent

[CODE]...

1 problem: Warning: event 'Disposed' conflicts with property 'Disposed' in the base class 'DisposableObject' and should be declared 'Shadows'

2 problem: Error: Class 'InfragisticsToolStripBindableButton' must implement 'Property Site As ISite' for interface 'System.ComponentModel.IComponent'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.

Why should I implement "IComponent" if I implement "IBindableComponent"?

3 problem: How should I override "Dispose", if it's already implemented in the base class, but is not virtual apparently.

View 1 Replies

.net - Performance Of Implementation Of IComparer?

Jul 14, 2011

I'm sorting a collection of type "Document" (usually around 100k records). Sorting usually takes around 4-5 seconds, and I'm wondering if there's a way to speed up sorting by modifying my "DocumentComparer" class which implements IComparer(Of Document). Since the Compare() method would be called hundreds of thousands of times, are there any performance improvements that could be made here that I've overlooked?

[Code]...

View 2 Replies

.net - Some IBindableComponent Interface Implementation?

Feb 8, 2011

I need to implement the IBindableComponent to the the following code:

Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent

[code].....

View 2 Replies

2d - .NET Liang-Barsky Implementation?

Nov 6, 2010

After some research, I've decided to use the Liang-Barsky line clipping algorithm in my 2D game. Google did not deliver on any VB.NET implementations of this algorithm but plenty C/++ ones. Therefore, as I have knowledge in C++, decided to port one found on Skytopia over to VB.Net. Unfortunately, it does not work with:

Public Class PhysicsObject
Public Function CollideRay(ByVal p0 As Point, ByVal p1 As Point, ByRef clip0 As Point, ByRef clip1 As Point) As Boolean
Dim t0 As Double = 0.0
Dim t1 As Double = 1.0

[code]....

However, the CollideRay method fails on its 3rd edge iteration (edge = 3), r < t0, therefore the function returns false.

View 1 Replies

Asp.net - Error On An Icomparer Implementation

Nov 12, 2010

I created an array sorter to sort arrays like in Win Explorer in a DNN module. As in the answer to a preview question: Sorting an array of folder names like Windows Explorer (Numerically and Alphabetically) - VB.NET

[Code]....

View 1 Replies

C# - Free Implementation Of Printf?

Mar 1, 2010

The problems:

I can't use string.Format, I have C style format strings;I can't call the native printf (no P/Invoke);I can't use http://www.codeproject.com/KB/printing/PrintfImplementationinCS.aspx because of the license, I need something GPL-compatible.Is there a free implementation of printf/sprintf for the .net framework? Other than the above link, I couldn't find anything.

I cooked up a sprintf function that supports basic format strings, you can find it here: [URL].. I'll try to make it a complete implementation if I can.

View 3 Replies

Conversion Types For DLL Implementation?

Aug 23, 2010

I need to use some functions from a DLL written in C++. Problem is when I try to use those functions in VB (Visual Studio). The only way I get to pass the debugger without errors is if I use the VariantType type, but I get all screwed up values. Can anyone tell me how can I "translate" the use of char [6] into VB from C++? My problem when Implementing is with the variable INFO, the content comes back after execution with errors..This is the original code from the DLL Manual:

Code:
Int Get_Info(A Handle, char *IPAddr, InfoType *Info)
where the parameters:
A [IN] Handle.
IPAddr [IN] IP address

[code]....

View 4 Replies

Convert C# Event Implementation To VB?

Apr 11, 2012

I am trying to use some C# code that expands on the GridView functionality in a VB.NET project. The code I'm using is from here.

In the C# code there is an event definition for GroupHeader [code]...

View 2 Replies

Implementation Of IDisposable Into Classes

Mar 8, 2009

I implemented IDisposable into one of my classes, but don't know if I did it correctly. Can someone tell me what will be cleared from memory and what will remain after calling .Dispose on an instance of this class? [Code]

View 5 Replies

Interface Implementation Deference?

May 21, 2010

What is the diference of using interfaces like ...I have an interface

Public Interface IProDataSource
Function read() As Integer
End Interface[co]....de

The only difference I have notice is that if the method is declare private it will be visible using the first approach only.

View 3 Replies

Is LinkedList Implementation Of .Net Threadsafe

Apr 26, 2011

I am working on an application which uses multiple threads to work on number of tasks and the parent application receives the output of the task,later to be written to files, currently I am using arraylist to append output to, but that happens to be slow when removing items from queue.I was thinking to convert arraylist part to linkedlist for optimized reads and clears,if linkedList Implementation of .Net is threadsafe or even using arraylist was threadsafe?

View 3 Replies

Our App Uses: ASP.Net, .Net, And Microsoft's AJAX Implementation?

Mar 3, 2011

The middleware that manages talk between the mainframe and our app is blowing up randomly. It's a "such and such attempted to read/write protected memory..." error.The vendor is saying there we must be running some unmanaged code (I feel they're trying to worm out of it). I know VB's entirely managed, but does anyone know about the server portion of AJAX? Is there any server side javascript stuff that occurs before it actually gets into the .NET framework?

View 1 Replies

Program To An Interface Instead Of Implementation?

Dec 25, 2009

I have been reading about design patterns and application architecture and im told that I should program to an interface instead of implementation. This i understand. So I figured I would start with something small. Never programmed with an interface before. So I want to create an encryption program that will allow the user to select which method to encrypt it with, AES, DPAPI, etc. I started designing the Interface but I am unsure if I am doing this right. [Code] Also, when it comes to the DPAPI implementation, how is the client supposed to supply the Protection Scope? I didn't think this should be in the interface as it only applys to the DPAPI.

View 1 Replies

Getting Fast Hex Reader?

Feb 7, 2011

I've been developing a simple virus scanner and it works by reading the hex code of a file and comparing it to signatures from a database. Anyway, the only thing slowing it down is how it reads the hex. This is the hex reading part of my code so far:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadFile.Click
Dim ArrayHold() As Byte
Dim Index As Integer = 0
Dim Str As New StringBuilder

[code]....

View 1 Replies

What To Do If RichTextBox Is Not Fast Enough

May 17, 2010

What I need is to highlight multiple matches within some portion of text as the user types a search pattern. Right now I'm using a RichTextBox to highlight text. The highlighting takes place if a user changes the search pattern and naturally it happens with each key press. It works, but I'm experiencing a performance issues. If the text is large enough the highlighting takes too long (up to several seconds).
Facing that I tried to launch the highlighting procedure in a different thread aborting it and launching it again if the search pattern was changed during the highlighting but still I'm not satisfied with performance. Now I'm asking if there some other control I could use to speed up the process?

View 6 Replies

Wpf - UI Not Updating Fast?

May 13, 2011

Following is the code I used for reading the files and folders from a drive etc.

Public Class LoadingBox
Public counter As ULong
Public OpenRecords As New Dictionary(Of String, MainWindow.records)

[code].....

View 2 Replies

.net - Optimize This Simple But Horrible Implementation?

Jul 27, 2011

I basically want to remove the formula from the cells but want to retain the calculated values.

SO, I implemented it easily and it works great but REALLY SLOW. (About 2 mins for 1800 cells)

I have : Dim col As Excel.Range = getRange()For Each cell In col cell.Value = cell.Value Next

I tried to do this to the first cell and then autofill the rest, but that copied the value of 1st cell to the rest of the cells in column.

View 7 Replies

Best Practice Example Of An MVP Implementation Of Unit Testing

May 4, 2009

Can anyone point me towards a complete scenario using MSTest,vb.net, with or without mocks,MVP (supervising controller)

View 1 Replies

C# - Custom SNMP Trap Implementation In .Net?

Oct 2, 2009

I need to create a monitoring mechanism using SNMP (in .Net). I think we'll be using an nsoftware component to handle most of the work. It appears we must use 'traps' to communicate from the agent to the server. We'll have a number of different traps and various information detailing each trap. What is the best way to implement custom traps? That is, what is the best way to not only send a trap, but also send the information describing the trap to our 'snmp manager'? I think this is done through "variable bindings". To use "variable bindings" do we need to create our own "enterprise number" and use an "enterpriseSpecific" trap? Should we implement our own, custom MIBs or can we just send the data we need with the trap (via variable bindings)?

View 2 Replies

C# - User-initiated Action Implementation?

Aug 17, 2010

In Flash 10 there are methods that require that they are triggered from user-initiated actions like button click, keyboard up/down keys, etc.Is it possible to implement this behaviour in .NET? For example, if we have this subroutine:

void SomeMethod() {
// Here some stuff
}

how to check inside it whether the method was called from a mouse click event handler?Also we can think of this methods like the protected functions in World of Warcraft.

EDIT: Looks like this behaviour is implemented in Silverlight — we can popup file dialogs (open, save) ONLY by mouse click or other user-initiated action, otherwise a SecurityException will be thrown. I want to achieve this bevaviour but in my case it's not a file dialog but our own methods.

View 2 Replies

Change The Implementation Functino Of IDisposable?

Dec 30, 2009

just wondering if we could change the implementation functino of IDisposable.Dispose to a private. because the default i've got something like this:

[Code]...

Protected Overridable Sub Dispose(ByVal disposing As Boolean) or could i take away the the Protected Overridable and replace it with a Private access modifier?

View 9 Replies

Convert Interface Implementation From Program To C#?

Sep 11, 2010

This may seem like an obvious answer, but I can't seem to find an answer. I have this code in VB.NET[code]...

The problem with this is that in C#, it would seem you have to name the function the same as the interface function you are implementing. How can I call this method EncryptionVB instead of Encryption, but still implement the Encryption property?

View 5 Replies

Explicit Interface Implementation In Program?

Oct 16, 2009

How to implement explicit interface implementation in VB.NET?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved