signals

simulation of oqpsk

hi for the simulation of oqpsk i have written the below values = [0;1;0;0;1;0;1;0]; h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = logical(demodulate(g,y)); BER = sum(values(:)-z(:))/numel(values); my questions are as follows: 1) how can i verify that it does what i expect it to d...

Drawing a single guideline over several NPlots or alternative solution

I am using NPlot charting library to draw several plots illustrating signal fluctuations. The plots are inserted one beneath the other in a flowlayoutpanel1. The x axis is the time. The y is the value of the signal. I've added a trackbar at the bottom, along the x axis. When the user moves the trackbar, the value of each signal is dis...

How to avoid the interruption of sleep calls due to a signal in Linux

Hello all, I'm using a real time signal in Linux to be notified of the arrival of new data in a serial port. Unfortunately this causes sleep calls to be interrupted when there is signal. Does anybody know of a way to avoid this behavior. Edit: I tried using a regular signal (SIGUSR1) but I keep getting the same behavior. Thanks, Joao ...

Pitch detection using FFT for trumpet.....

Hi...How do i get frequency using FFT? What's the right procedure and codes? ...

Explain void (*signal(int signo, void *(func)(int)))(int)

Please explain this type signature. ...

Wait for condition from multiple resources in pthread

I have a number of data containers that can send a signal when there are updates in them. The structure looks similar like this: typedef struct { int data; /*...*/ pthread_cond_t *onHaveUpdate; } Container; The onHaveUpdate is a pointer to a global condition that is shared by all the containers In my application, I have a numbe...

Multithreaded C program; how to kill processes spawned by threads?

Situation: I am writing a program in C that maintains a number of threads. Once a thread ends, a new one is created. Each thread forks - the child runs a process via exec() and the parent waits for it to finish. In addition, there is a signal handler thread that waits for signals. If SIGINT is detected then it tells the main threa...

is python variable assignment atomic?

Let's say I am using a signal handler for handling an interval timer. def _aHandler(signum, _): global SomeGlobalVariable SomeGlobalVariable=True Can I set SomeGlobalVariable without worrying that, in an unlikely scenario that whilst setting SomeGlobalVariable (i.e. the Python VM was executing bytecode to set the variable), that t...

modem.oqpskmod -> modem.oqpskdemod not same result

hi, i am trying to simulate the IEEE 802.15.4/ZigBEE PHY,... chip_values = [ 1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,0; 1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0; 0,0,1,0,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,0,1,0; 0,0,1,0,0,0,1,0,1,1,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0...

The Unreliable Signal API - Code doesnt work as expected

Basically,expected output of is that it catches KeyboardInterrupt 5 times and exits the 6th time.(If 1st line of handler() is un-commented) Now, if i comment that line too, then also the behavior of program doesnt change even though I am using unreliable API. As I have used signal() function, this is unreliable bcos after the...

Get signalled when a file handle is acquired

What's the best way for getting signalled (similar to AutoResetEvent) when an exclusive handle to a file is acquired? (e.g. at the end of a huge file copy) ...

Interrupt all running signals in Python?

Hi, How can I interrupt all running signals in a Python script? I would like something like signal.interrupt_all(). Is there any way to do that? Thanks ...

When to use signals and slots and when not to

We're using Qt that offers signals and slots which I find really convenient. However, with great power comes great responsibility and I think it's very easy too misuse this feature. Are there any best-practices for signal-slot usage? I'm having a hard time to find some general guidelines in this manner. Some questions (I have clear opi...

Is it possible to signal handler to survive after "exec" ?

I wrote a signal handler for a process, and fork() after that, the signal handler will be applied to both parent and child processes. If I replace the child process with "exec", the signal handler is no more. I know this happens because "exec" call will overwrite the child process address space with it's own. I just want to know if ther...

Why is post_save being raised twice during the save of a Django model?

I am attaching a method to the post_save signal of my Django model. This way I can clear some cached items whenever the model is modified. The problem I am having is that the signal is being triggered twice when the model is saved. It doesn't necessarily hurt anything (the code will just gracefully error out) but it can't be right. A ...

Qt C++ WebKit windowCloseRequested Signal

Hey All, I am trying to connect QWebpage::windowCloseRequested() to a slot that just prints out a debug message. When I call window.close(); in JavaScript it doesn't bubble the signal up or call the slot... connect(webView->page(), SIGNAL(windowCloseRequested()),this, SLOT(windowCloseRequested())); The slot is setup, it is in my wind...

Is there a way to test whether I'm in a signal handler?

I'm having to work on a logging module that can be called from various places in a large project. The problem I have is that sometimes the module may be called from code executed inside a signal handler. Normally, the logging module includes time data using localtime() and strftime(), but of course these calls are not async-signal safe...

Are calls to signal() done across all threads?

Are calls to signal() done across all threads in a process? Or do you have to call signal for each signal you want to catch per thread? Thanks, Chenz ...

fork() within a fork()

Hi Is there any way to differentiate the child processes created by different fork() functions within a program. global variable i; SIGCHLD handler function() { i--; } handle() { fork() --> FORK2 } main() { while(1) { if(i<5) { i++; if( (fpid=fork())==0) --> FORK1 handle() else (f...

How do I guarantee cleanup code runs in Windows C++ (SIGINT, bad alloc, and closed window)

I have a Windows C++ console program, and if I don't call ReleaseDriver() at the end of my program, some pieces of hardware enter a bad state and can't be used again without rebooting. I'd like to make sure ReleaseDriver() gets runs even if the program exits abnormally, for example if I hit Ctrl+C or close the console window. I can use ...