Friday, 26 March 2021

The 29th Annual Running Of The University Of Oxford Digital Signal Processing Course Will Now Be Held Online In 2021

The 29th annual running of the University Of Oxford Digital Signal Processing course has been over subscribed so we are re-running the course in the Autumn.

The online course was first held in 2020 and had excellent reviews from the attendees.

The next course will be run over a period of 6 weeks between Monday 27th September and Friday 5th November 2021.

Based on the classroom course, Digital Signal Processing (Theory and Application), this online course consists of weekly live online tutorials and also includes a software lab that can be run remotely. We'll include all the same material, many of the existing labs and all the interaction of the regular course.

Online tutorials are delivered via Microsoft Teams once each week and practical exercises are set to allow you to practice the theory during the week. 

You will also have access to the course VLE (virtual learning environment) to communicate with other students, view and download course materials and tutor support is available throughout.

Code examples will be provided although no specific coding experience is required. 

The live tutorials will be on Wednesday each week from 13:00 - 14:30 and 15:00 - 16:30 (GMT) with a 30-minute break in between.

You should allow for 10 - 15 hours study time per week in addition to the weekly lessons and tutorials.

After completing the course, you should be able to understand the workings of the algorithms we explore in the course and how they can solve specific signal processing problems.

Full Details Are Available Here


Wednesday, 3 March 2021

Integrating Visual Studio Compiler Tools With Visual Studio Code

Integrating Visual Studio compiler tools with Visual Studio Code is a really powerful solution for developing and debugging C/C++ code.

Assuming you have installed Visual Studio Code and Visual Studio compiler tools then before continuing I highly recommend installing the C/C++ for Visual Studio Code extension.

Here are the steps I have for the integration process:

Enable a "VS 2019 Community Prompt Here" integration with Explorer. I've based my solution on Daniel Cazzulino's excellent CommandPromptHere solution that is available here: https://github.com/kzu/CommandPromptHere.

This supports x86 compiler configuration by default so I've modified it slightly to enable x64 compilation and called the file "VS201964BitComCmdHere.inf"

;
; "CMD Prompt Here" PowerToy
;
; Copyright 1996 Microsoft Corporation
[version]
signature="$CHICAGO$"
[DefaultInstall]
CopyFiles = VS2019ComCmdHere.Files.Inf
AddReg    = VS2019ComCmdHere.Reg
[DefaultUnInstall]
DelFiles  = VS2019ComCmdHere.Files.Inf
DelReg    = VS2019ComCmdHereUninstall.Reg
[SourceDisksNames]
55="%VS2019ComCmdHereName%","",1
[SourceDisksFiles]
vs2019cmdhere-enterprise.inf=55
[DestinationDirs]
VS2019ComCmdHere.Files.Inf = 17
[VS2019ComCmdHere.Files.Inf]
VS2019ComCmdHere.INF
[VS2019ComCmdHere.Reg]
HKLM,%UDHERE%,DisplayName,,"%VS2019ComCmdHereName%"
HKLM,%UDHERE%,UninstallString,,"rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUnInstall 132 %17%\VS2019ComCmdHere.inf"
HKCR,Directory\Background\Shell\VS2019ComCmdHere,,,"%VS2019ComCmdHereAccel%"
HKCR,Directory\Background\Shell\VS2019ComCmdHere\command,,,"cmd.exe /k call ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"" && pushd ""%V"""
HKCR,Directory\Shell\VS2019ComCmdHere,,,"%VS2019ComCmdHereAccel%"
HKCR,Directory\Shell\VS2019ComCmdHere\command,,,"cmd.exe /k call ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"" && pushd ""%V"""
HKCR,Drive\Shell\VS2019ComCmdHere,,,"%VS2019ComCmdHereAccel%"
HKCR,Drive\Shell\VS2019ComCmdHere\command,,,"cmd.exe /k call ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"" && pushd ""%1"""
[VS2019ComCmdHereUninstall.Reg]
HKLM,%UDHERE%
HKCR,Directory\Shell\VS2019ComCmdHere
HKCR,Drive\Shell\VS2019ComCmdHere
HKCR,Directory\Background\Shell\VS2019ComCmdHere
[Strings]
VS2019ComCmdHereName="Developer Command Prompt Here for VS2019 Community"
VS2019ComCmdHereAccel="VS 2019 Community Prompt"
UDHERE="Software\Microsoft\Windows\CurrentVersion\Uninstall\VS2019ComCmdHere"

To use VS Code with Visual Studio, in the project folder you need to create a .vscode/launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "cl.exe - Build and debug active file",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "externalTerminal",
            //"console": "internalConsole",
            "preLaunchTask": "C/C++: cl.exe build active file"
        }
    ]

}

and a .vscode/tasks.json file:

{
"version": "2.0.0",
"tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: cl.exe build active file",
            "command": "cl.exe",
            "args": [
                "/Zi",
                "/EHsc",
                "/nologo",
                "-W4",
                "-D" "_CRT_SECURE_NO_WARNINGS=1",
                "/Fe:",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
                "${file}",
                "gnuplot_c.lib"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$msCompile"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "compiler: cl.exe"
        }
    ]

}

Now open VSCode and open the project folder: File | Open Folder ...

Save the workspace: File | Save Workspace As ...

Close VSCode

Now to use VSCode with Visual Studio, right click on the project folder in Explorer and choose: "VS2019 Community Prompt"

Type the following:

code workspace.code-workspace

You can now compile and debug your application, with full break point and single stepping support.


Monday, 11 January 2021

The 29th Annual Running Of The University Of Oxford Digital Signal Processing Course Will Now Be Held Online In 2021

As part of the University Of Oxford Summer Engineering Program for Industry, the 29th running of the Digital Signal Processing course is moving online.
The online course was first held in 2020 and had excellent reviews from the attendees.

The next course will be run over a period of 6 weeks between Wednesday 28th April and Tuesday 8th June 2021.

Based on the classroom course, Digital Signal Processing (Theory and Application), this online course consists of weekly live online tutorials and also includes a software lab that can be run remotely. We'll include all the same material, many of the existing labs and all the interaction of the regular course.


Online tutorials are delivered via live video once each week and practical exercises are set to allow you to practice the theory during the week. 
You will also have access to the course VLE (virtual learning environment) to communicate with other students, view and download course materials and tutor support is available throughout.
Code examples will be provided although no specific coding experience is required. 
The live tutorials will be on Wednesday each week from 13:00 - 14:30 and 15:00 - 16:30 (GMT) with a 30-minute break in between.
You should allow for 10 - 15 hours study time per week in addition to the weekly lessons and tutorials.
After completing the course, you should be able to understand the workings of the algorithms we explore in the course and how they can solve specific signal processing problems.


Sunday, 10 January 2021

A Simple And Portable C Command Line Option Parser

I recently had to write some cross platform code with a simple command line parser.

Rather than get caught up in any open source licensing issues I wrote my own.

To use the code, just add your options into parse_command_line () and update the messages in show_help (). 

Here it is, to use as you wish.

// Command line parser
// Copyright (c) 2021 Sigma Numerix Ltd
#include <stdlib.h>
#include <stdio.h>

// Command line options
int     d_number = 0;
int     f_flag = 0;
int     l_flag = 0;
char    s_string[80] = "";

void show_help (void);
void parse_command_line (int argc, char *argv[]);
void main (int argc, char *argv[])
{
    parse_command_line (argc, argv);                        //  Parse command line options
    printf ("d_number  : %d\n", d_number);
    printf ("f_flag    : %d\n", f_flag);
    printf ("l_flag    : %d\n", l_flag);
    printf ("s_string[]: \"%s\"\n", s_string);
    exit(0);
}
void parse_command_line (int argc, char *argv[])
{
    for (int argNum = 1; argNum < argc; argNum++) {
        if (*(argv[argNum]) == '-') {
            switch (*(argv[argNum]+1)) {                    // Get command letter
                case 'd':
                    d_number = (unsigned int)atoi(argv[argNum+1]);
                    if ((d_number < 0) || (d_number > 9)) {
                        printf ("Command line error: Debug number range 0..9\n");
                        exit(-1);
                    }
                    argNum++;
                    break;
                case 'f':
                    f_flag = 1;
                    break;
                case 'l':
                    l_flag = 1;
                    break;
                case 'S':
                    strcpy (s_string, argv[argNum+1]);
                    argNum++;
                    break;
                case 'h':
                    show_help ();
                    exit (0);
                    break;
                default:
                    printf ("Invalid parameter combination\n");
                    show_help ();
                    exit (0);
                    break;
            }
        }
        else {
            printf ("Invalid parameter combination\n");
            show_help ();
            exit (0);
        }
    }
}

void show_help (void)
{
    printf ("cmdline Example Program\n\n");
    printf ("usage: cmdline [-fhl] [-d debug_number]\n");
    printf ("   [-s debug_string]\n");
    printf ("       -d  Debug number (default: 0, range 0-9)\n");
    printf ("       -f  f option flag\n");
    printf ("       -l  l option flag\n");
    printf ("       -S  Debug string (default: empty)\n");
    printf ("       -h  Help\n\n");
}