MATLAB ... but what about C# ....

Show off any of your RTL-SDR or cheap SDR related projects.
Post Reply
User avatar
slava
Posts: 7
Joined: Mon Apr 17, 2017 11:30 pm

MATLAB ... but what about C# ....

Post by slava » Mon Apr 17, 2017 11:43 pm

Is it possible to interface with my SDR dongle using C# .NET ?

rtlsdrblog
Site Admin
Posts: 1877
Joined: Mon Nov 19, 2012 11:54 pm

Re: MATLAB ... but what about C# ....

Post by rtlsdrblog » Tue Apr 18, 2017 3:03 am

Yes, you'd just need a wrapper for the librtlsdr, this probably does the job https://github.com/librtlsdr/SharpRTL.

Popular software like SDR# is coded in C#, and you can of course use any programming language to implement the DSP you need.

bobasaurus
Posts: 17
Joined: Wed Dec 27, 2017 4:36 am
Location: Colorado

Re: MATLAB ... but what about C# ....

Post by bobasaurus » Fri Jan 12, 2018 10:13 pm

I write C# code for the RTL-SDR. The link by rtlsdrblog is a good one, you can also browse the source code for an older version of SDR# here:

https://github.com/cgommel/sdrsharp

It involves using dllimport like this:

Code: Select all

public const string LibRtlSdr = "rtlsdr.dll";
[DllImport(LibRtlSdr, EntryPoint = "rtlsdr_get_device_count", CallingConvention = CallingConvention.Cdecl)]
private static extern uint rtlsdr_get_device_count();

rtlsdrblog
Site Admin
Posts: 1877
Joined: Mon Nov 19, 2012 11:54 pm

Re: MATLAB ... but what about C# ....

Post by rtlsdrblog » Fri Jan 12, 2018 11:32 pm

Nice, looks like the import is quite easy.

Post Reply