Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for some help, want to create an audio base Radio IF Signal Processor [IF SDR] #250

Open
pa3akp opened this issue Jun 25, 2017 · 5 comments
Labels

Comments

@pa3akp
Copy link

pa3akp commented Jun 25, 2017

Let me first comment that CSCore is an amazing project, the first one I have ever seen with such details.

What do I want to create. I am an HAM radio operator and want to create in C#, with the help of CSCore, a universal Audio IF (IF = Intermediate Frequency) signal processor to built a IF SDR (software defined Radio).
The signal processing is meant to demodulate radio signals converted from the 455kHz IF of my receiver into a 12kHz IF. The modulation types can be AM, FM, USB, LSB,.... whatever.

Next to the IF processing, I would like to create Audio Based signal processing of of signals like SSTV(Slow Scan Television, WEFAX (Weather Fax Maps), APT(Automatic Picture Transmission from weather satelllites), RTTY ( Radio TeleType) etc etc.

Also custom filtering DSP must be one of the features (Low Pass, High Pass etc)

As a first step for help:

At the moment I already can sample the incoming Audio, using one of the samples in CScore, and place them info a buffer with a programmable size. Making use of Zedgraph I can display the sampled time domain and using AlgLib and Zedgraph to create a spectral plot.

In the code below, I store each sample of the single block read in a buffer of 2^n samples. When the buffer has all the points I show time domain or (after FFT) show freq domain.

QUESTION: how can I replay the contents of this (unprocessed) data back again to the audio output of the soundcard?

Thanks Onno de Meijer

private void SingleBlockNotificationStreamOnSingleBlockRead(object sender, SingleBlockReadEventArgs e)
        {
            // Filling of FFT-list to 'totSamples' points
            if (fftBufferPointer < totSamples - 1)         //This statement was < is now !=

            {
                // Array without the Window function for the Scope, no windowing
                fftBufferL.Add(Convert.ToDouble(e.Left));
                fftBufferR.Add(Convert.ToDouble(e.Right));


                // if the form SpectrumAnalyserForm is open, then work on the FFT data points.
                                                
                switch (fftWindow)
                // Depending on the sampling winwdow type, fill the Array 'windowedBuffer(L)(R)' with windowed sample points
                {
                case "hamming":
                    windowedBufferL.Add(Convert.ToDouble(e.Left) * (0.54 - 0.46 * Math.Cos((2 * Math.PI * fftBufferPointer) / (totSamples - 1))));
                    break;
                case "hanning":
                    windowedBufferL.Add(Convert.ToDouble(e.Left) * 0.5 * (1 - Math.Cos((2 * Math.PI * fftBufferPointer) / (totSamples - 1))));
                    break;
                case "blackman-harris":
                    windowedBufferL.Add(Convert.ToDouble(e.Left) * (0.35875 - 0.48829 * Math.Cos((2 * Math.PI * fftBufferPointer) / (totSamples - 1)) + 0.14128 * Math.Cos((4 * Math.PI * fftBufferPointer) / (totSamples - 1)) - 0.01168 * Math.Cos((6 * Math.PI * fftBufferPointer) / (totSamples - 1))));
                    break;
                }
                
                
                // Increment the fftBufferPointer
                fftBufferPointer++;

            }
            else
            {
                //Debug.Print(windowedBufferL.Count.ToString());

                fftBufferPointer++;

                // Is the ScopeForm loaded?
                Form fc = Application.OpenForms["ScopeForm"];
                if (fc != null)
                {
                    // Call the scope display with the list converted to an array
                    audioToScope(fftBufferL.ToArray());
                }


                // Is the SpecAnForm loaded?
                fc = Application.OpenForms["SpectrumAnalyserForm"];
                if (fc != null)
                {
                    // Call the specan display with the list converted to an array
                    audioToSpecAn(windowedBufferL.ToArray());
                }
                
                // Clear the audio time-span buffers and the pointer
                fftBufferL.Clear();
                fftBufferR.Clear();

                windowedBufferL.Clear();
                windowedBufferR.Clear();

                fftBufferPointer = 0;
            }
        }
@pa3akp
Copy link
Author

pa3akp commented Jun 25, 2017

To make it more clear : the data which resides in the buffer fftBufferL and/or fftBufferR

Onno

@filoe
Copy link
Owner

filoe commented Jul 2, 2017

As far as I understood you correct, you would like to do a IFFT on the fftBufferL and fftBufferR, store the samples in a buffer again and play them?

@filoe filoe added the question label Jul 2, 2017
@pa3akp
Copy link
Author

pa3akp commented Jul 2, 2017 via email

@filoe
Copy link
Owner

filoe commented Oct 21, 2017

Any news on that?

@pa3akp
Copy link
Author

pa3akp commented Oct 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants