Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

2006-05-14 Thread Achilleas Anastasopoulos


I run the following simple test, compiled with
g++ test.cc -o test
and I got the following results.
I see a 4-fold speed reduction using STL.
What am I doing wrong?

Achilleas


---
$ time ./test 1 1
real0m0.121s
user0m0.120s
sys 0m0.001s

while

$ time ./test 1 2
real0m0.462s
user0m0.459s
sys 0m0.003s

and

$ time ./test 10 1
real0m1.185s
user0m1.184s
sys 0m0.001s

while

$ time ./test 10 2
real0m4.597s
user0m4.595s
sys 0m0.002s
--


test.cc=
#includevector

int main(int ac,char **av) {

const int M = 1000;
std::vectorint y(M);
int *x;
x=(int*)malloc(M*sizeof(int));

int N=atoi(av[1]);

if(atoi(av[2])==1) {
for (int i=0;iN;i++)
for(int j=0;jM;j++)
x[j]=i/(j+1);
} else if(atoi(av[2])==2) {
for (int i=0;iN;i++)
for(int j=0;jM;j++)
y[j]=i/(j+1);
}

}
==





___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

2006-05-14 Thread Achilleas Anastasopoulos


Yes, with -O the STL code is only 1.7 times
slower.

Even better, with -O2 the two cases execute
in exactly the same time.

So, is Gnuradio compiling with -O2
option?

Achilleas




Philip Balister wrote:

Try g++ -O test.cc -o test

That solved the problem for me.

Philip

Achilleas Anastasopoulos wrote:



I run the following simple test, compiled with
g++ test.cc -o test
and I got the following results.
I see a 4-fold speed reduction using STL.
What am I doing wrong?

Achilleas


---
$ time ./test 1 1
real0m0.121s
user0m0.120s
sys 0m0.001s

while

$ time ./test 1 2
real0m0.462s
user0m0.459s
sys 0m0.003s

and

$ time ./test 10 1
real0m1.185s
user0m1.184s
sys 0m0.001s

while

$ time ./test 10 2
real0m4.597s
user0m4.595s
sys 0m0.002s
--


test.cc=
#includevector

int main(int ac,char **av) {

const int M = 1000;
std::vectorint y(M);
int *x;
x=(int*)malloc(M*sizeof(int));

int N=atoi(av[1]);

if(atoi(av[2])==1) {
for (int i=0;iN;i++)
for(int j=0;jM;j++)
x[j]=i/(j+1);
} else if(atoi(av[2])==2) {
for (int i=0;iN;i++)
for(int j=0;jM;j++)
y[j]=i/(j+1);
}

}
==



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] 48KHz audio board

2006-05-14 Thread Eric Blossom
On Sat, May 13, 2006 at 11:49:03PM +0200, Vincenzo Pellegrini wrote:
 sorry, i know that the question might be silly but:
 
 my audio board requires 48Ksps
 the fm receiver in gnu radio examples delivers to it 32Ksps instead.
 setting a overall decimation factor of 1320 i can get as near as 48484
 samples/sec.
 
 but even if much better, this still gives problems. and there's no
 integer factor that can take 64Msps to exactly 48Ksps.
 
 can anyone help a newbie?
 
 Thanks
 
 Vincenzo Pellegrini
 Italy  

If you're using ALSA, try plughw:0,0

  or

use gr-audio-oss instead.

Eric



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] 48KHz audio board

2006-05-14 Thread Eric Blossom
On Sun, May 14, 2006 at 08:37:11AM +0930, Daniel O'Connor wrote:
 On Sunday 14 May 2006 07:19, Vincenzo Pellegrini wrote:
  my audio board requires 48Ksps
  the fm receiver in gnu radio examples delivers to it 32Ksps instead.
  setting a overall decimation factor of 1320 i can get as near as 48484
  samples/sec.
 
  but even if much better, this still gives problems. and there's no
  integer factor that can take 64Msps to exactly 48Ksps.
 
  can anyone help a newbie?
 
 I think you need a resampling function (or a smarter sound card ;)
 
 eg sox can resample from one frequency to another, I don't know if there is 
 such a block in GNURadio though.

gr.rational_resampler.

See gnuradio-examples/audio/test_resampler.py

Eric


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

2006-05-14 Thread Eric Blossom
On Sun, May 14, 2006 at 09:40:16AM -0400, Achilleas Anastasopoulos wrote:
 
 I run the following simple test, compiled with
 g++ test.cc -o test
 and I got the following results.
 I see a 4-fold speed reduction using STL.
 What am I doing wrong?
 
 Achilleas

You're not using the standard level of optimization -O2

E.g.,

[EMAIL PROTECTED] tmp]$ g++ -O2 test.cc -o test
[EMAIL PROTECTED] tmp]$ time ./test 10 1

real0m1.797s
user0m1.792s
sys 0m0.004s
[EMAIL PROTECTED] tmp]$ time ./test 10 2

real0m1.797s
user0m1.796s
sys 0m0.000s


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

2006-05-14 Thread Eric Blossom
On Sun, May 14, 2006 at 11:13:47AM -0400, Achilleas Anastasopoulos wrote:
 
 Yes, with -O the STL code is only 1.7 times
 slower.
 
 Even better, with -O2 the two cases execute
 in exactly the same time.
 
 So, is Gnuradio compiling with -O2
 option?

Yes.

Eric


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Re: Graphical programming with Ptolemy [rather: Deep dependencies]

2006-05-14 Thread Patrick Strasser

John Clark wrote:
It seems to becoming an 'annual' event that I setup a GNURadio 
environment, and this year's candidate machine seems to have almost
nothing of the antecedent packeges... 


This is not exactly the content you would expect from the subject. I 
know i'm a little late, but shouldn't the subject be changed?
Moreover the references are kept with replying, so diligent clients 
thread the messages misleading...


Patrick
--
Engineers motto: cheap, good, fast: choose any two
Patrick Strasser patrick dot strasser at  tugraz dot at
Student of Telematik, Techn. University Graz, Austria



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] 'module' object has no attribute

2006-05-14 Thread Lee Patton
I am attempting to build modified versions of gr_file_source, and
gr_file_sink outside of gnuradio-core.  I have successfully built, and
used my version of file_source (called rad_wvfm_source). However, I
cannot get my version of file_sink (called rad_wvfm_sink) to build into
a module so that it is callable from python.  My python QA script fails
with an AttributeError: 'module' object has no attribute 'wvfm_sink'.

I've attached my swig files. Any help is appreciated.

Thanks,
 - Lee

P.S. 

You can browse all the code at http://svn.pattoncentral.org, just click
gr_radar. If it is easier, you can check out the code with

$] svn co http://svn.pattoncentral.org/gr_radar --username=anon

and empty password.
/* -*- c++ -*- */
/*
 * Copyright 2004 Free Software Foundation, Inc.
 * 
 * This file is part of GNU Radio
 * 
 * GNU Radio is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 * 
 * GNU Radio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with GNU Radio; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

%feature(autodoc, 1);   // generate python docstrings

%include exception.i
%import gnuradio.i// the common stuff

%{
#include gnuradio_swig_bug_workaround.h   // mandatory bug fix
#include stdexcept
%}

%{
#include rad_wvfm_sink.h
#include rad_wvfm_source.h
%}

%include rad_wvfm_sink.i
%include rad_wvfm_source.i
GR_SWIG_BLOCK_MAGIC(rad,wvfm_sink)

rad_wvfm_sink_sptr 
gr_make_wvfm_sink (size_t itemsize, const char *filename);

class rad_wvfm_sink : public gr_sync_block
{
 protected:
  rad_wvfm_sink (size_t itemsize, const char *filename);

 public:
  ~rad_wvfm_sink ();

  /*! 
   * \brief open filename and begin output to it.
   */
  bool open(const char *filename);

  /*!
   * \brief close current output file.
   */
  void close();
};
%constant int SEEK_SET = 0; /* Seek from beginning of file. */
%constant int SEEK_CUR = 1; /* Seek from current position.  */
%constant int SEEK_END = 2; /* Seek from end of file.   */

GR_SWIG_BLOCK_MAGIC(rad,wvfm_source)

rad_wvfm_source_sptr 
rad_make_wvfm_source (size_t itemsize, const char *filename, bool repeat=false);

class rad_wvfm_source : public gr_sync_block
{
 protected:
  rad_wvfm_source (size_t itemsize, const char *filename, bool repeat);

 public:
  ~rad_wvfm_source ();

  bool seek (long seek_point, int whence);
};

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] 'module' object has no attribute

2006-05-14 Thread Martin Dvh
Lee Patton wrote:
 I am attempting to build modified versions of gr_file_source, and
 gr_file_sink outside of gnuradio-core.  I have successfully built, and
 used my version of file_source (called rad_wvfm_source). However, I
 cannot get my version of file_sink (called rad_wvfm_sink) to build into
 a module so that it is callable from python.  My python QA script fails
 with an AttributeError: 'module' object has no attribute 'wvfm_sink'.
If you use:
GR_SWIG_BLOCK_MAGIC(rad,wvfm_sink)

Then should use:
rad_make_wvfm_sink

in stead of:
gr_make_wvfm_sink


I hope this helps,
Martin


 
 I've attached my swig files. Any help is appreciated.
 
 Thanks,
  - Lee
 
 P.S. 
 
 You can browse all the code at http://svn.pattoncentral.org, just click
 gr_radar. If it is easier, you can check out the code with
 
 $] svn co http://svn.pattoncentral.org/gr_radar --username=anon
 
 and empty password.
 
 
 
 
 ___
 Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org
 http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] depad for atsc 2

2006-05-14 Thread Martin Dvh
Charles Swiger wrote:
 I just added atsc_depad to cvs gr-atsc.
 
 The 2.x code worked thru derandomizer, but the output was
 atsc_mpeg_packet padded out to 256, which xine/mplayer won't
 play. Kludging atsc_mpeg_packet pad to 0 in atsc_types.h 
 worked with a warning from gnuradio about output not being
 a power-of-2.  atsc_depad reads padded atsc_mpeg_packets
 and writes 188 byte char packets. That function might be
 better built into derandomizer anyway.
 
 Also put the 0.9 boundary checking in the atsc_viterbi_decoder.
 That was causing problems getting past bumps in the input
 signal like usrp overrun dropped packets.
 
 Also added the missing gr_agc.h for atsc_fpll.
gr_agc.h is still in gnuradio-2.x but it was renamed to gri_agc.h 4 months ago.
The i was added to make it consistent with the rest of the gnuradio framework,
to distinguish flowgraph blocks from helper function objects (gri_agc is a 
helper object).

At the same time a compex agc was added as gri_agc_cc.h

These are now also used in the gr_agc_cc and gr_agc_ff blocks.

Greetings,
Martin

 
 --Chuck
 
 
 
 
 
 ___
 Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org
 http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
 



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] running

2006-05-14 Thread David Caruth
Hello!I've just started playing with GnuRadio and the USRP, and was hoping to run it on Windows XP. I found Martin's installer "setup-gnuradio-complete-2.6cvs.exe" and it worked great. I then triedto run the example to listen to some radio (I had this running with a fedora core 5 linux installation with the same usrp). I received the following error messages:C:\caruthd\usrp\gnuradio-examples-0.7\python\usrppython usrp_wfm_rcv.py -f 101.1  found 5 bussesUsing RX d'board A: TV Rx gr_fir_ccf: using SSE gr_fir_fff: using SSETraceback (most recent call last): File "usrp_wfm_rcv.py", line 268, in ? app = stdgui.stdapp (wfm_rx_graph, "USRP WFM RX") File "C:\Python24\Lib\site-packages\gnuradio\wxgui\stdgui.py", line 36, in __init__ wx.App.__init__ (self,
 redirect=False) File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_core.py", line 7700,in __init__ self._BootstrapApp() File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_core.py", line 7352,in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "C:\Python24\Lib\site-packages\gnuradio\wxgui\stdgui.py", line 39, in Oninit frame = stdframe (self.flow_graph_maker, self.title, self._nstatus) File "C:\Python24\Lib\site-packages\gnuradio\wxgui\stdgui.py", line 60, in __init__ self.panel = stdpanel (self, self, flow_graph_maker) File "C:\Python24\Lib\site-packages\gnuradio\wxgui\stdgui.py", line 81, in __init__ self.fg = flow_graph_maker (frame, self, vbox, sys.argv) File "usrp_wfm_rcv.py", line 93, in __init__ False) #
 ok_to_block File "C:\Python24\Lib\site-packages\gnuradio\audio_windows.py", line 213, insink return _audio_windows.sink(*args)NotImplementedError: No matching function for overloaded 'sink'  I had seen a previous post where Eric replied that a hex string needed to be replaced by a gr function with the hex string as an argument, but from looking through the .py files called here, i did not see anything obvious. has anyone else had this problem? thanks in advance for any help! oh, and by the way, "usrp_fft.py" ran without a problem.Thanks a lot!  Dave
		Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] 'module' object has no attribute

2006-05-14 Thread Lee Patton
Thanks Martin! I was staring at that code for a half hour, and didn't
see it. I even grepped 'gr_' to see if it was something like that, and I
still didn't see it

Thanks for your time.

On Mon, 2006-05-15 at 00:55 +0200, Martin Dvh wrote:
 Lee Patton wrote:
  I am attempting to build modified versions of gr_file_source, and
  gr_file_sink outside of gnuradio-core.  I have successfully built, and
  used my version of file_source (called rad_wvfm_source). However, I
  cannot get my version of file_sink (called rad_wvfm_sink) to build into
  a module so that it is callable from python.  My python QA script fails
  with an AttributeError: 'module' object has no attribute 'wvfm_sink'.
 If you use:
 GR_SWIG_BLOCK_MAGIC(rad,wvfm_sink)
 
 Then should use:
 rad_make_wvfm_sink
 
 in stead of:
 gr_make_wvfm_sink
 
 
 I hope this helps,
 Martin
 
 
  
  I've attached my swig files. Any help is appreciated.
  
  Thanks,
   - Lee
  
  P.S. 
  
  You can browse all the code at http://svn.pattoncentral.org, just click
  gr_radar. If it is easier, you can check out the code with
  
  $] svn co http://svn.pattoncentral.org/gr_radar --username=anon
  
  and empty password.
  
  
  
  
  ___
  Discuss-gnuradio mailing list
  Discuss-gnuradio@gnu.org
  http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
 



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Modem and/or ADSL Daughter card

2006-05-14 Thread David Young
On Wed, May 10, 2006 at 07:24:07PM -0700, Eric Blossom wrote:
 On Thu, May 04, 2006 at 02:01:31PM -0400, Michael Milner wrote:
  Hello,
  
  I was just wondering if anyone has used GNURadio for any non-radio
  applications, specifically phone line modulation/demodulation.
  
  It shouldn't be too difficult to design a daughter board for the USRP to
  sample phone line voltage (with an appropriate line interface circuit of
  course).  After that it should be rather easy in GNURadio to generate DTMF
  tones for dialing, and modem tones for data communication.
  
  Any thoughts?
  Mike
 
 A simple DAA (Data Access Arrangement) plus the LF daughterboard would
 probably work.  There are two chip DAA's available.  Been a while
 since I looked, but I think that Crystal Semiconductor used to make
 them.  Google solid state daa There's also the classic Midcom
 transformer plus a couple of other discretes.  These things are tricky
 to get right.  You definitely want to find somebody's reference design
 and use that.  Or use the pre-approved chipset.
 
 The USRP is pretty much thermonuclear overkill for this application.
 You could just use a sound card with a DAA.  That's how all the
 soft-modems work.  IIRC some of the the AC97 codecs support a second
 channel for telecom (modem) apps.

Here is an example that uses a sound card, http://www.araneus.fi/audsl/.

idle-musing
It would be neat if there were the PC audio-out equivalents of the
iGo iTips power adapter plugs, with plugs that adapt audio-out to
media such as AC powerline, phone wire, Cat5, and television cable.
A suitable software modem would adapt to whatever medium was on hand,
adding a new dimension to ad hoc networking.
/idle-musing

Dave

-- 
David Young OJC Technologies
[EMAIL PROTECTED]  Urbana, IL * (217) 278-3933


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Problem with making sound card as source

2006-05-14 Thread 2 1
Thanks Breett:) I've solved this problem by turn on capture item in the
mixer. And I guess that's why there are many people say that there
linux cannot recording sound.

Hanwen2006/5/10, Brett L Trotter [EMAIL PROTECTED]:
I had a similar problem- turned out not to be the hardware.Run alsamixer and make sure to turn on capture on your line input (withspacebar) and turn up the volume all the way, then turn on capture oncapture and turn the volume up all the way again. You should then be
getting audio and adjust the volume down to reduce clipping.2 1 wrote: Hi, Matt :) I do set the line-in as the record source in the mixer. But I found that the audio recorder app of my FC4 can't record either. I'm doubt that the sound
 drive of FC4 cannot support the card well. Besides, I tried on 3 different machines and all of them failed. They all have a intel integrated sound card. I'm using gr-audio-alsa.0.3.tar.gz.
 Have you ever met this problem before? And do you know how to make the sound card well supported under linux? Thanks a lot. Hanwen 2006/5/10, Matt Ettus 
[EMAIL PROTECTED]: Can you record sound in other applications?Have you set the audio mixer properly? Matt
 On Tue, 2006-05-09 at 20:34 +0800, 2 1 wrote:  Hi, all   My USRP is on delievering, so I try to do someting with the sound  card.
   Unfortunately, the integrated AC97 sound card of my pc seem to not  work properly as source.  I connect a mp3 player with the line-in port of sound card with an
  audio wire.  In a script, the sound card is set to source and connected to a file  sink, so the sampled raw audio is written to a file.  In another script, the raw audio file is set to the source and
  replayed by the sound card as sink.  But, I hear nothing from my sound card.   The dialtone.py can work making the sound properly, so the sound card  as sink is ok.
   Hanwen  ___  Discuss-gnuradio mailing list  Discuss-gnuradio@gnu.org
  http://lists.gnu.org/mailman/listinfo/discuss-gnuradio -- Matt Ettus [EMAIL PROTECTED]
  ___ Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
___Discuss-gnuradio mailing listDiscuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio