|
Digital Signal Processing
|
|
|
|
|
DSP stands for Digital Signal Processing.
I'am an electrical engineering student, that's is why i have weird questions sometimes.
F.K
|
|
|
|
|
|
What do you want to do with it?
I don't use a DSP myself, but I'm interfacing one
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
I don't know if you people are familiar with DSP.
I am processing data and i have several modules, filter low-pass, high pass, equalizer.
I would like know to sample the data (sine wave) i get after the last module.
Hope this explanation brought somehow some light.
F.K
|
|
|
|
|
This worked for me on a project i just finished.
double readDouble(istream& is)
{
char buffer[sizeof(double)];
is.read(buffer,sizeof(double));
return (double)(*(reinterpret_cast<double*>(buffer)));
}
But make sure that the data is in the right order, (big endian / little endian) otherwise you might have to reverse the order of the bytes in the buffer. I'd be interested to know if it works
|
|
|
|
|
Hi,
How does this piece of code works?
double readDouble(istream& is){ char buffer[sizeof(double)]; is.read(buffer,sizeof(double)); return (double)(*(reinterpret_cast(buffer)));}
Sorry,not very familiar with C programming
F.K
|
|
|
|
|
flora_k wrote:
How does this piece of code works?
Simple idea really
1/ read enough data out of the file to rebuild one number
2/ convert that data into a number
Why like this? There are simpler ways, and this isn't safe, in fact its downright ugly, but it's extensible for big endian data.
BTW, this is C++ code. sorry missed that on the first readthrough, you'll probably need to use fopen and fclose to do the file management in C, and the cast to a C-Style cast. Below is a fuller example, might help if you can see it in context
#include <fstream>
#include <iostream>
using namespace std;
double readDouble(istream& is)
{
char buffer[sizeof(double)];
is.read(buffer,sizeof(double));
return (double)(*(reinterpret_cast<double*>(buffer)));
}
int main()
{
ifstream fin("your_filename_here.bin",ios::in|ios::binary);
double data;
int numPoints = 1000;
for(int i = 0; i < numPoints; ++i)
{
data = readDouble(fin);
cout << data << endl;
}
return 0;
}
|
|
|
|
|
Hello
Can any please tell me if it is possible for an application to read memory outside the memory area allocated to my program.....
for example if i want to read first 1000 bytes of memory is it possible?
ahmed
|
|
|
|
|
As far as I know, when a program attempts to read memory not belonging to it, a crash ensues.
|
|
|
|
|
|
Muhammad Ahmed wrote:
to read memory outside the memory area allocated to my program.....
There really isn't a physical memory "allocated" to your program, every application has its own "virtual memory" in the operating system environment and some parts of this space may be in the physical memory while some may be on the pagefile. I think you should first read about the topic "virtual memory" before digging into kernel mode drivers or dos etc.
|
|
|
|
|
Hello,
I want to develop an application, which involves communicating with EPABX through PC, in such a way that I should be able to get all the details about phone calls made like call duration, etc.
Any help is highly appriciated.
Tushar Bhatt
|
|
|
|
|
I uses SGI STL in one of my project and it works very good in VS 6.0.
But when i compile it under VS2003 i get
d:\Projects\STL\sgi\stl_alloc.h(305) : fatal error C1001: INTERNAL COMPILER ERROR
Anyone know if there are any compiler setting I need to changed to be able to compile SGI STL with VS2003 ?
|
|
|
|
|
What are the best online C++ tutorials for experienced VB developers who need to learn C++ fast. In other words, they need one that is both clear and concise.
To put this in perspective, I have a friend who is a VB developer who's been thrown in at the deep end. This is what he said:
"My boss agreed to write a component for a company that wanted it as a small download. He incorrectly thought you didn't need the VB VM library (weighing in at 1.6 MB) and that we could do it in VB6.
So we'll have to do it in VC++ ver6. What he thought might take 3 days will now probably take 3 weeks - talk about a loss leader! I haven't got the first clue about VC++. I did a little C on UNIX back in my 2nd year ar Uni and placement year, but that was 13 years ago. I may need to pick your brains a little, concerning the MFC. Is it quite large ? Our component has to be under 1MB to download, so the client thought that would rule out using the MFC.
Basically, the component has no interface, it just needs to sit in the system tray and every hour interrogate a fixed URL to determine if there are any changes to the page. If so, the system tray icon should change colour and should a bubble with some text in it and then (when clicked on) open the browser and take the user to that page. It needs to store the URL and frequency with which to check it in an ini file or the registry.
We've got some code to handle the system tray icons and I've got some code to download a web page to a file, but then we need to parse the text for any changes. Not sure how they'll be determined yet. We're not sure what we'll need to do in terms of a setup and deployment package. Will everything needed be built into the .exe file or will it have dependencies on anything such as the MFC dll(s) ?"
I've suggested using ATL and, in fact, there's an example on Code Project that appears to do exactly what he wants.
I suppose the question is really: "How little C++ does he need to know to achieve his objective?"
I have extensive experience with MFC, but nothing in components. I've done a little ATL but not commercially.
Kevin
|
|
|
|
|
|
I was thinking of online tutorials really.
But could a VB developer who knows no C++ dive straight into this book?
Kevin
|
|
|
|
|
He/she could try . Seriously though, if I were you, I would not worry about C++ skill as much as understanding of COM/ATL. After all C++ in ATL is strait forward. I saw some VB guys learning bits of C++ pretty fast (6 months +), but making horrific mistakes in COM (like infamous in/out parameters allocation/deallocation).
As for online, "there could be only one";) - MSDN
|
|
|
|
|
I taught several experienced VB programmers how to code in Visual C++, and creating ATL components.
On average, they took about 3 months to start coding interesting things, and about 6 months to become good C++ programmers. Sure, they became much better VB programmers after that.
IMHO, 3 weeks for such a project, for people who have no experience at all on it, is a shoot on your own foot.
Kevin McFarlane wrote:
Will everything needed be built into the .exe file or will it have dependencies on anything such as the MFC dll(s) ?"
Yes, you can statically link MFC, the runtime and ATL, producing a standalone .EXE.
Kevin McFarlane wrote:
Is it quite large ? Our component has to be under 1MB to download, so the client thought that would rule out using the MFC.
I can make the world spin reversed in a 1MB MFC executable
If the application is as simple as you mentioned, a properly optimized project should be in the 200Kb~300Kb range, without depending on any runtime DLLs. Compressed, it becomes under 100Kb.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Thanks. That's useful info.
Daniel Turini wrote:
IMHO, 3 weeks for such a project, for people who have no experience at all on it, is a shoot on your own foot.
I agree. He should blame his boss!
Kevin
|
|
|
|
|
hi,
i need to disable tray menu item form different dialog box.
can you help me?
|
|
|
|
|
What do you mean with "from a different dialog box"?
Just call EnableMenuItem(wndMyMenu, ID_MENUITEM, MF_DISABLED) ?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
BTW: You have to do this in WM_INITMENU
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Thank u Rickard.
Thank u very much for ur reply.
i already solved this problem.
|
|
|
|
|
hi,
can anyone tell me where to find some docuentation and/or examples on broadcast client/server communication in VC++?
thanx
|
|
|
|